From 4b9cd2a9a6e9eca6f7fd2f282c132774b3575a24 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:01:31 -0700 Subject: [PATCH] [Backport release-rogue] Add index on `quorum_proposals.leaf_hash` (#2214) Add index on `quorum_proposals.leaf_hash` (#2208) We look up by this column during state reconstruction, so we should probably index it. The unique index will also prevent us from inserting quorum proposals with different views but the same hash, which should not be possible and would be a logic error if it happened. (cherry picked from commit ee6f7d44061108f363cc6fda1aeaa056ed322925) Co-authored-by: Jeb Bearer --- .../api/migrations/V42__index_quorum_proposal_leaf_hash.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sequencer/api/migrations/V42__index_quorum_proposal_leaf_hash.sql diff --git a/sequencer/api/migrations/V42__index_quorum_proposal_leaf_hash.sql b/sequencer/api/migrations/V42__index_quorum_proposal_leaf_hash.sql new file mode 100644 index 0000000000..d65488f883 --- /dev/null +++ b/sequencer/api/migrations/V42__index_quorum_proposal_leaf_hash.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX quorum_proposals_leaf_hash_idx ON quorum_proposals (leaf_hash);