codeintel: Add missing foreign key indexes
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).