Adds performance linting to melange doctor and fixes two bugs reported by community contributors.
No breaking changes from v0.7.1. Upgrade and run melange migrate to pick up fixes.
Performance Linting in melange doctor
The doctor command now detects missing expression indexes for ::text casts in the melange_tuples view — the #1 production performance
issue, causing 26x slower queries at 1M tuples.
- Parses view definition via
pg_get_viewdef()to detectUNIONvsUNION ALLand enumerate source tables - Detects missing
::textexpression indexes per source table with severity based on row count and exactCREATE INDEXfix hints - Disable via
--skip-performanceflag ordoctor.skip_performanceconfig
Bug Fixes
-
Fix
list_objectsmissing results for closure userset patterns (#30) —list_*_objects
only expanded userset lookups for the first relation in a closure. When multiple relations shared the same userset pattern, only one got SQL
expansion. Thanks to @jtbeach for the fix. -
Fix uppercase relation names breaking re-migration (#26) — Schemas with uppercase relation
names caused functions to be dropped on re-migration due to a casing mismatch betweenCollectFunctionNamesand PostgreSQL's identifier
folding. Thanks to @Desuuuu for reporting and submitting an initial fix
(#27).