Skip to content

feat(api): add partial index for recoverable sandboxes#4154

Open
brunogrbavac wants to merge 2 commits intomainfrom
feat/recoverable-sandbox-index
Open

feat(api): add partial index for recoverable sandboxes#4154
brunogrbavac wants to merge 2 commits intomainfrom
feat/recoverable-sandbox-index

Conversation

@brunogrbavac
Copy link
Collaborator

Description

Adds a partial index on the sandbox table for rows where recoverable is true. Only a minuscule fraction of rows match this condition, so the index is tiny and eliminates full table scans when querying recoverable sandboxes on draining runners.

Documentation

  • This change requires a documentation update
  • I have made corresponding changes to the documentation

Signed-off-by: Bruno Grbavac <bruno.grbavac@outlook.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new TypeORM pre-deploy migration to improve performance when selecting “recoverable” sandboxes by introducing a partial index on the sandbox table.

Changes:

  • Add a pre-deploy migration that creates a partial index for sandbox rows where recoverable = true.
  • Add rollback logic to drop the index.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Bruno Grbavac <bruno.grbavac@outlook.com>
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.

2 participants