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
18 changes: 18 additions & 0 deletions packages/db/migrations/0372_drop_binary_search_indexes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Drops the five binary-quantized ANN indexes on "embedding_search". Ranking walks the
-- half-precision graphs; no reader has ordered by a hamming distance on this projection since
-- half-precision search shipped, so each index was maintained on every chunk write for nothing,
-- and the populated one doubled the cost of filling the projection's source and ACL columns.
-- The binary columns stay for now: the projection sync trigger still writes them.
COMMIT;--> statement-breakpoint
SET lock_timeout = 0;--> statement-breakpoint
-- migration-safe: DROP INDEX CONCURRENTLY IF EXISTS is idempotent on replay and takes no blocking lock.
DROP INDEX CONCURRENTLY IF EXISTS "embedding_search_binary_hnsw_idx";--> statement-breakpoint
-- migration-safe: DROP INDEX CONCURRENTLY IF EXISTS is idempotent on replay and takes no blocking lock.
DROP INDEX CONCURRENTLY IF EXISTS "embedding_search_384_binary_hnsw_idx";--> statement-breakpoint
-- migration-safe: DROP INDEX CONCURRENTLY IF EXISTS is idempotent on replay and takes no blocking lock.
DROP INDEX CONCURRENTLY IF EXISTS "embedding_search_768_binary_hnsw_idx";--> statement-breakpoint
-- migration-safe: DROP INDEX CONCURRENTLY IF EXISTS is idempotent on replay and takes no blocking lock.
DROP INDEX CONCURRENTLY IF EXISTS "embedding_search_1024_binary_hnsw_idx";--> statement-breakpoint
-- migration-safe: DROP INDEX CONCURRENTLY IF EXISTS is idempotent on replay and takes no blocking lock.
DROP INDEX CONCURRENTLY IF EXISTS "embedding_search_3072_binary_hnsw_idx";--> statement-breakpoint
SET lock_timeout = '5s';
8 changes: 8 additions & 0 deletions packages/db/migrations/0373_keyword_tin_document_index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- The document ACL trigger fans a document's source and ACL out to the keyword projection by
-- document id; with no index on that column every ACL change scanned the whole projection.
COMMIT;--> statement-breakpoint
SET lock_timeout = 0;--> statement-breakpoint
-- migration-safe: replay replaces only this new index to recover an interrupted concurrent build; existing indexes remain available.
DROP INDEX CONCURRENTLY IF EXISTS "embedding_keyword_tin_document_idx";--> statement-breakpoint
CREATE INDEX CONCURRENTLY IF NOT EXISTS "embedding_keyword_tin_document_idx" ON "embedding_keyword_tin" USING btree ("document_id");--> statement-breakpoint
SET lock_timeout = '5s';
Loading
Loading