Commit 069c440
* Fixes #27158: restore tag_usage prefix-LIKE index on Postgres
The 1.11.0 perf migration (#23054) added four `WHERE state = 1` partial
indexes on tag_usage; #24063 dropped the matching `state = 1` predicate
from getTagsInternalByPrefix (Suggested-state rows are valid for both
classification and glossary derivation), leaving every partial index
inapplicable. Postgres fell back to a parallel seq scan; MySQL was
unaffected because its 1.11.0 indexes were never partial.
Adds non-partial single-col btrees on targetfqnhash_lower and
tagfqn_lower (mirror MySQL's idx_targetfqnhash_lower / idx_tagfqn_lower)
and rebuilds the four partials as non-partial -- same shape, same
INCLUDE columns, predicate coupling removed so future query changes
can't silently invalidate them.
Backport of #27745 (main) onto the 1.12.7 release line so customers on
1.12.x get the fix without waiting for 2.0.x.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Drop new indexes before CREATE to defuse failed-CONCURRENTLY edge case
If CREATE INDEX CONCURRENTLY fails partway (lock timeout, OOM,
connection drop on a busy multi-GB tag_usage), Postgres leaves the
index in an INVALID state. A subsequent CREATE ... IF NOT EXISTS sees
the catalog row and silently skips, leaving the index permanently
broken while the migration reports success.
The four composite indexes already use the DROP-then-CREATE pattern;
applying the same to the two new single-col indexes for symmetry.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9fdc925 commit 069c440
4 files changed
Lines changed: 38 additions & 0 deletions
File tree
- bootstrap/sql/migrations/native/1.12.7
- mysql
- postgres
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments