Changeset qbit-alerts:30 adds three indexes. It is additive and uses IF NOT EXISTS:
ix_alerts_alert_monitor_id_status on alerts_alert (monitor_id, status). MonitorEvaluator looks up a per-record monitor's open alerts by monitorId + status IN open on every evaluation (engine/MonitorEvaluator.java:282). The join alerts_monitor -> alerts_alert also uses it.
ix_alerts_monitor_alert_type_id on alerts_monitor (alert_type_id), for the "Monitors" section on the type record.
ix_alerts_type_group_id on alerts_type (group_id), for the "Alert Types" section on the group record and the group roll-ups.
Why
This came out of an index audit of the qbits installed on kof22. These three were the only one-to-many join child columns with no leading index.
Tests
New AlertsQBitProducerTest.testJoinChildColumnsAreIndexed checks every join in AlertsTableMetaDataHelper.buildJoins() against the shipped changelog. It accepts a CREATE INDEX, an inline UNIQUE, or a renamed ix_<table>_<column> index.
The test fails without changeset 29.
./mvnw verify is green locally.
kof22 gets the same indexes now through its own dated changeset, so it does not need to wait for a release.
## What
Changeset `qbit-alerts:30` adds three indexes. It is additive and uses `IF NOT EXISTS`:
- `ix_alerts_alert_monitor_id_status` on `alerts_alert (monitor_id, status)`. `MonitorEvaluator` looks up a per-record monitor's open alerts by `monitorId` + `status IN open` on every evaluation (`engine/MonitorEvaluator.java:282`). The join `alerts_monitor -> alerts_alert` also uses it.
- `ix_alerts_monitor_alert_type_id` on `alerts_monitor (alert_type_id)`, for the "Monitors" section on the type record.
- `ix_alerts_type_group_id` on `alerts_type (group_id)`, for the "Alert Types" section on the group record and the group roll-ups.
## Why
This came out of an index audit of the qbits installed on kof22. These three were the only one-to-many join child columns with no leading index.
## Tests
- New `AlertsQBitProducerTest.testJoinChildColumnsAreIndexed` checks every join in `AlertsTableMetaDataHelper.buildJoins()` against the shipped changelog. It accepts a `CREATE INDEX`, an inline `UNIQUE`, or a renamed `ix_<table>_<column>` index.
- The test fails without changeset 29.
- `./mvnw verify` is green locally.
kof22 gets the same indexes now through its own dated changeset, so it does not need to wait for a release.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
Changeset
qbit-alerts:30adds three indexes. It is additive and usesIF NOT EXISTS:ix_alerts_alert_monitor_id_statusonalerts_alert (monitor_id, status).MonitorEvaluatorlooks up a per-record monitor's open alerts bymonitorId+status IN openon every evaluation (engine/MonitorEvaluator.java:282). The joinalerts_monitor -> alerts_alertalso uses it.ix_alerts_monitor_alert_type_idonalerts_monitor (alert_type_id), for the "Monitors" section on the type record.ix_alerts_type_group_idonalerts_type (group_id), for the "Alert Types" section on the group record and the group roll-ups.Why
This came out of an index audit of the qbits installed on kof22. These three were the only one-to-many join child columns with no leading index.
Tests
AlertsQBitProducerTest.testJoinChildColumnsAreIndexedchecks every join inAlertsTableMetaDataHelper.buildJoins()against the shipped changelog. It accepts aCREATE INDEX, an inlineUNIQUE, or a renamedix_<table>_<column>index../mvnw verifyis green locally.kof22 gets the same indexes now through its own dated changeset, so it does not need to wait for a release.
🤖 Generated with Claude Code