diff --git a/go/enclave/storage/init/edgelessdb/001_init.sql b/go/enclave/storage/init/edgelessdb/001_init.sql index 387417c697..5f35eb0335 100644 --- a/go/enclave/storage/init/edgelessdb/001_init.sql +++ b/go/enclave/storage/init/edgelessdb/001_init.sql @@ -83,7 +83,8 @@ create table if not exists obsdb.batch INDEX USING HASH (hash), INDEX USING HASH (l1_proof_hash), INDEX (l1_proof), - INDEX (height) + INDEX (height), + INDEX (is_canonical, is_executed, height) ); GRANT ALL ON obsdb.batch TO obscuro; diff --git a/go/enclave/storage/init/sqlite/001_init.sql b/go/enclave/storage/init/sqlite/001_init.sql index 1085d1a45e..bc81cb0cd1 100644 --- a/go/enclave/storage/init/sqlite/001_init.sql +++ b/go/enclave/storage/init/sqlite/001_init.sql @@ -75,6 +75,7 @@ create index IDX_BATCH_HASH on batch (hash); create index IDX_BATCH_BLOCK on batch (l1_proof_hash); create index IDX_BATCH_L1 on batch (l1_proof); create index IDX_BATCH_HEIGHT on batch (height); +create index IDX_BATCH_HEIGHT_COMP on batch (is_canonical, is_executed, height); create table if not exists tx (