Files
ITWorx-Pulse-Public/internal/database/migrations/0018_inventory_read_indexes.sql
T
ITWorx Pulse release export bd774932d5
Public source validation / validate (push) Failing after 3m8s
Publish ITWorx Pulse source
2026-09-03 02:09:19 +02:00

17 lines
685 B
SQL

CREATE INDEX IF NOT EXISTS entities_type_canonical_idx
ON entities (entity_type, canonical_name, id)
WHERE tombstoned_at IS NULL;
CREATE INDEX IF NOT EXISTS entities_status_canonical_idx
ON entities (status, canonical_name, id)
WHERE tombstoned_at IS NULL;
CREATE INDEX IF NOT EXISTS entity_relations_source_entity_idx
ON entity_relations (source_entity_id, relation_type, target_entity_id);
CREATE INDEX IF NOT EXISTS entity_relations_target_entity_idx
ON entity_relations (target_entity_id, relation_type, source_entity_id);
CREATE INDEX IF NOT EXISTS entity_facts_freshness_idx
ON entity_facts (entity_id, valid_until, field_name, observed_at DESC);