Skip to content

Commit 6478b57

Browse files
committed
fix(coprocessor): add missing indexes for selecting allowed handles when tx unsent
1 parent 2531f02 commit 6478b57

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- Improve indexing for SNS worker selection queries
2+
3+
CREATE INDEX IF NOT EXISTS idx_pbs_computations_pending_created_at
4+
ON pbs_computations (created_at, handle)
5+
WHERE is_completed = FALSE;
6+
7+
CREATE INDEX IF NOT EXISTS idx_ciphertexts_handle_not_null
8+
ON ciphertexts (handle)
9+
WHERE ciphertext IS NOT NULL;
10+
11+
--- Improve indexing for Tx-sender selection queries
12+
13+
CREATE INDEX IF NOT EXISTS idx_allowed_txn_is_sent
14+
ON allowed_handles (txn_is_sent);
15+
16+
CREATE INDEX IF NOT EXISTS idx_allowed_txn_retries
17+
ON allowed_handles (txn_limited_retries_count)
18+
WHERE txn_is_sent = false;

coprocessor/fhevm-engine/db-migration/migrations/20251230155309_improve_sns_worker_select_indexing.sql

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)