chore(schema): drop project-specific idx_os_cat_events_upcoming (#131)#195
Merged
jensens merged 2 commits intoJun 29, 2026
Merged
Conversation
The partial index referenced show_in_sidecalendar — an AAF project field, not generic Plone — and was never used by the planner (0 scans on the very deployment it was built for, superseded there by a project-applied index). The sidecalendar slowness it targeted (#131) was resolved generically once path became a typed column (#132, accurate stats for the selective path predicate) and boolean queries were normalised. Remove the CREATE + the EXPECTED_INDEXES entry + the schema-reference doc row, and add a DROP INDEX IF EXISTS so existing installs self-heal on the next deploy. Closes #131 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jensens
deleted the
chore/drop-project-specific-events-upcoming-index-131
branch
June 29, 2026 22:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Final generic cleanup for #131. The sidecalendar planner problem is resolved generically; what remained was a project-specific, unused index in the generic schema.
Why
idx_os_cat_events_upcomingreferencedshow_in_sidecalendar— an AAF project field, not generic Plone — and was the only such reference in the whole package. On aaf-prod (the deployment it was built for) it had 0 scans: the project applies its ownidx_os_cat_show_in_sidecalendar(30 scans) instead.The original #131 slowness was resolved generically by changes that landed since the April diagnosis:
pathbecame a typed column (Stop duplicating path/parent_path/path_depth in idx JSONB; migrate indexes & queries to typed columns #132) → the selective path predicate now has real PG statistics, so the planner is no longer JSONB-blind (this was Sidecalendar query: planner picks wrong index due to JSONB-blind cost model #131's recommended direction (b)).(idx->>'…')::boolean→ the text-vs-boolean inconsistency is gone.Empirically on aaf-prod, the sidecalendar slow-query shape dropped from 924 calls / avg 514 ms / max 1.8 s (April) to 4 calls / avg 72 ms / max 91 ms (last 7 days).
Change
CREATEfromschema.py, theEXPECTED_INDEXESentry, and the schema-reference doc row.DROP INDEX IF EXISTS idx_os_cat_events_upcoming;so existing installs self-heal on the next deploy (its DDL hash change re-triggers via the schema-version gate).Tests
tests/test_schema.py: newtest_legacy_events_upcoming_index_self_healscreates the legacy index, re-runs the schema, and asserts it's dropped. 9 passed.Closes #131
🤖 Generated with Claude Code