Skip to content

codeintel: Add missing foreign key indexes

Warren Gifford requested to merge ef/fk-indexes into main

Created by: efritz

On a foreign key from TA(x) -> TB(y), Postgres will create an index on TB(y) but not on TA(x) automatically. I think a lot of developers assume both directions are indexed.

This change massively increases the speed of the UpdateNumDependencyReferences query, which is the currently dominating factor of LSIF upload processing.

Note: I have created two indexes in Cloud that need to be removed after merging this PR (eftemp1 and eftemp2 on the lsif_packages and lsif_references tables).

Merge request reports

Loading