Skip to content

feat: add covering indexes for capacity and cleanup queries#47

Merged
Theauxm merged 1 commit intomainfrom
feat/capacity-cleanup-indexes
Mar 31, 2026
Merged

feat: add covering indexes for capacity and cleanup queries#47
Theauxm merged 1 commit intomainfrom
feat/capacity-cleanup-indexes

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented Mar 31, 2026

Summary

  • Add ix_metadata_active_capacity partial index on (train_state, manifest_id) INCLUDE (name) for LoadDispatchCapacityJunction — allows the exclusion filter to evaluate from the index without heap access
  • Add ix_metadata_cleanup partial index on (name, start_time) for terminal-state cleanup queries in DeleteExpiredMetadataJunction

Both indexes target the two highest-load Trax queries on a shared RDS r6g.large (0.28 and 0.19 load respectively).

Test plan

  • Run dotnet build — zero warnings
  • Run scheduler integration tests — all 644 pass
  • Verify indexes are created on migration via \di trax.* in psql

Add ix_metadata_active_capacity partial index on (train_state, manifest_id)
INCLUDE (name) for LoadDispatchCapacityJunction, and ix_metadata_cleanup
partial index on (name, start_time) for terminal-state cleanup queries.
@Theauxm Theauxm merged commit aa4ae23 into main Mar 31, 2026
1 check passed
@Theauxm Theauxm deleted the feat/capacity-cleanup-indexes branch March 31, 2026 20:44
@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented Mar 31, 2026

This PR is included in version 1.29.0

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.

1 participant