Skip to content

Commit

Permalink
Enclave DB: add composite index for canonical batch height
Browse files Browse the repository at this point in the history
  • Loading branch information
BedrockSquirrel committed Aug 27, 2024
1 parent cc056c4 commit 11693a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/enclave/storage/init/edgelessdb/001_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions go/enclave/storage/init/sqlite/001_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
(
Expand Down

0 comments on commit 11693a1

Please sign in to comment.