fix(schema): index the record-page child columns folder_id and object_id #19

Merged
KofTwentyTwo merged 1 commits from feature/object-id-indexes into develop 2026-10-14 22:36:49 +00:00
KofTwentyTwo commented 2026-10-14 20:25:30 +00:00 (Migrated from github.com)

What

ObjectStorageSchema now generates three more indexes. Each is appended to its table's list, so the existing ix_<table>_<n> names do not change:

  • ix_object_storage_object_7 on object_storage_object (folder_id), for the Folder -> Objects child list
  • ix_object_storage_object_version_2 on object_storage_object_version (object_id), for Object -> Versions
  • ix_object_storage_object_reference_3 on object_storage_object_reference (object_id), for Object -> Referenced by and the object lookups in ActionSupport

Why

These relations (ObjectStorageTables.RELATIONS) filter on the parent id alone. Every existing index on these tables leads with bucket_id, so the child lists scan the table.

This came out of an index audit of the qbits installed on kof22.

Tests

  • New TablesAndConfigTest.testChildListColumnsAreIndexed pins the three generated statements and checks that an existing name keeps its number.
  • ./mvnw verify is green locally.

Hosts that copied the generated SQL need a changeset with the same statements. kof22's is in its features/2026-10-14-qbit-indexes.sql, using these same index names.

🤖 Generated with Claude Code

## What `ObjectStorageSchema` now generates three more indexes. Each is appended to its table's list, so the existing `ix_<table>_<n>` names do not change: - `ix_object_storage_object_7` on `object_storage_object (folder_id)`, for the Folder -> Objects child list - `ix_object_storage_object_version_2` on `object_storage_object_version (object_id)`, for Object -> Versions - `ix_object_storage_object_reference_3` on `object_storage_object_reference (object_id)`, for Object -> Referenced by and the object lookups in `ActionSupport` ## Why These relations (`ObjectStorageTables.RELATIONS`) filter on the parent id alone. Every existing index on these tables leads with `bucket_id`, so the child lists scan the table. This came out of an index audit of the qbits installed on kof22. ## Tests - New `TablesAndConfigTest.testChildListColumnsAreIndexed` pins the three generated statements and checks that an existing name keeps its number. - `./mvnw verify` is green locally. Hosts that copied the generated SQL need a changeset with the same statements. kof22's is in its `features/2026-10-14-qbit-indexes.sql`, using these same index names. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.