mirror of
https://github.com/docmost/docmost.git
synced 2026-06-10 10:13:01 +08:00
18222d1142
Postgres has no per-expression stats for `cells->>'uuid' ILIKE '%…%'`, `search_text ILIKE`, or `search_tsv @@`, so EXPLAIN Plan Rows falls back to a default selectivity and is off by orders of magnitude — a contains filter on a 10k-row base was reporting ~150 against thousands of real matches. Auto-route any request whose filter tree contains a contains/ncontains/startsWith/endsWith op or a search term to the capped-exact path, even when the caller asked for an estimate.