Skip to content

chore(schema): drop project-specific idx_os_cat_events_upcoming (#131)#195

Merged
jensens merged 2 commits into
mainfrom
chore/drop-project-specific-events-upcoming-index-131
Jun 29, 2026
Merged

chore(schema): drop project-specific idx_os_cat_events_upcoming (#131)#195
jensens merged 2 commits into
mainfrom
chore/drop-project-specific-events-upcoming-index-131

Conversation

@jensens

@jensens jensens commented Jun 29, 2026

Copy link
Copy Markdown
Member

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_upcoming referenced show_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 own idx_os_cat_show_in_sidecalendar (30 scans) instead.

The original #131 slowness was resolved generically by changes that landed since the April diagnosis:

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

  • Remove the CREATE from schema.py, the EXPECTED_INDEXES entry, and the schema-reference doc row.
  • Add 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: new test_legacy_events_upcoming_index_self_heals creates the legacy index, re-runs the schema, and asserts it's dropped. 9 passed.

Closes #131

🤖 Generated with Claude Code

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
jensens merged commit bbd9331 into main Jun 29, 2026
4 checks passed
@jensens
jensens deleted the chore/drop-project-specific-events-upcoming-index-131 branch June 29, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidecalendar query: planner picks wrong index due to JSONB-blind cost model

1 participant