Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/db/src/migrations/0107_classy_ultimo.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "kiloclaw_instances" ADD COLUMN "tracked_image_tag" text;--> statement-breakpoint
CREATE INDEX "IDX_kiloclaw_instances_tracked_image_tag" ON "kiloclaw_instances" USING btree ("tracked_image_tag") WHERE "kiloclaw_instances"."destroyed_at" is null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: Build this index concurrently

kiloclaw_instances is already populated, and a plain CREATE INDEX takes a write-blocking lock until the index build finishes. Use a concurrent index build (or another safe migration path) so instance lifecycle writes are not blocked during deployment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Based on my tests, index creation took less than 1 second. Only 1 table is locked. Requests are queued. I feel like this is not a huge concern.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also relatively speaking a pretty small table. we'll have less than 75k record in it.

Loading