Fixes potential slow reverse lookup queries when using Postgres by changing the order of the columns being compared in the cursor. By comparing the numerical IDs before the string relations, the query is able to short-circuit sooner and return faster.
Fixes potential slow reverse lookup queries when using Postgres by changing the order of the columns being compared in the cursor. By comparing the numerical IDs before the string relations, the query is able to short-circuit sooner and return faster.