39c5fbb633
The search table is an EAV schema where key and value are highly correlated, but standard single-column statistics can't model this. This caused the planner to underestimate compound filter queries by up to 1300x, choosing materialize-then-sort plans instead of LIMIT short-circuit index scans. CREATE STATISTICS captures the (key, value) correlation via dependencies, ndistinct, and most-common-values metadata. The planner then correctly estimates row counts and chooses the index-driven plan. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Fredrik Adelöw <freben@gmail.com>
522 B
522 B
@backstage/plugin-catalog-backend
| @backstage/plugin-catalog-backend |
|---|
| patch |
Added extended multi-column statistics on (key, value) in the search table (PostgreSQL only). This tells the query planner about the correlation between the key and value columns, fixing severe row count estimation errors on compound filter queries. Without this, the planner could choose to materialize and sort thousands of rows instead of using the LIMIT short-circuit index scan — causing 10-40x slower catalog list views when multiple filters are active.