diff --git a/backend/src/main/resources/db/migration/V77__add_timeline_events.sql b/backend/src/main/resources/db/migration/V77__add_timeline_events.sql index aba99c10..b83745e2 100644 --- a/backend/src/main/resources/db/migration/V77__add_timeline_events.sql +++ b/backend/src/main/resources/db/migration/V77__add_timeline_events.sql @@ -56,10 +56,9 @@ CREATE TABLE timeline_event_documents ( ); -- Indexes added up-front (avoid the V62 FK-index retrofit debt): the two query columns plus --- explicit indexes on all four FK columns. +-- the inverse-side FK columns. timeline_event_id needs no extra index on either join table — +-- it is the leading column of the composite PK, so the PK index already serves those lookups. CREATE INDEX idx_timeline_events_event_date ON timeline_events (event_date); CREATE INDEX idx_timeline_events_type ON timeline_events (type); CREATE INDEX idx_timeline_event_persons_person_id ON timeline_event_persons (person_id); -CREATE INDEX idx_timeline_event_persons_event_id ON timeline_event_persons (timeline_event_id); CREATE INDEX idx_timeline_event_documents_document_id ON timeline_event_documents (document_id); -CREATE INDEX idx_timeline_event_documents_event_id ON timeline_event_documents (timeline_event_id);