Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCF-3244 Index only the fifth word to reduce the db size overhead #13315

Merged
merged 2 commits into from
May 24, 2024
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
5 changes: 5 additions & 0 deletions .changeset/big-bats-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Reducing the scope of 0233 migration to include only 5th word index which is required for CCIP #db_update
Original file line number Diff line number Diff line change
@@ -1,65 +1,8 @@
-- +goose Up

drop index if exists evm.evm_logs_idx_data_word_one;
drop index if exists evm.evm_logs_idx_data_word_two;
drop index if exists evm.evm_logs_idx_data_word_three;
drop index if exists evm.evm_logs_idx_data_word_four;
drop index if exists evm.evm_logs_idx_topic_two;
drop index if exists evm.evm_logs_idx_topic_three;
drop index if exists evm.evm_logs_idx_topic_four;

create index evm_logs_idx_data_word_one
on evm.logs (address, event_sig, evm_chain_id, "substring"(data, 1, 32));

create index evm_logs_idx_data_word_two
on evm.logs (address, event_sig, evm_chain_id, "substring"(data, 33, 32));

create index evm_logs_idx_data_word_three
on evm.logs (address, event_sig, evm_chain_id, "substring"(data, 65, 32));

create index evm_logs_idx_data_word_four
on evm.logs (address, event_sig, evm_chain_id, "substring"(data, 97, 32));

create index evm_logs_idx_data_word_five
on evm.logs (address, event_sig, evm_chain_id, "substring"(data, 129, 32));

create index evm_logs_idx_topic_two
on evm.logs (address, event_sig, evm_chain_id, (topics[2]));

create index evm_logs_idx_topic_three
on evm.logs (address, event_sig, evm_chain_id, (topics[3]));

create index evm_logs_idx_topic_four
on evm.logs (address, event_sig, evm_chain_id, (topics[4]));

-- +goose Down

drop index if exists evm.evm_logs_idx_data_word_one;
drop index if exists evm.evm_logs_idx_data_word_two;
drop index if exists evm.evm_logs_idx_data_word_three;
drop index if exists evm.evm_logs_idx_data_word_four;
drop index if exists evm.evm_logs_idx_data_word_five;
drop index if exists evm.evm_logs_idx_topic_two;
drop index if exists evm.evm_logs_idx_topic_three;
drop index if exists evm.evm_logs_idx_topic_four;

create index evm_logs_idx_data_word_one
on evm.logs ("substring"(data, 1, 32));

create index evm_logs_idx_data_word_two
on evm.logs ("substring"(data, 33, 32));

create index evm_logs_idx_data_word_three
on evm.logs ("substring"(data, 65, 32));

create index evm_logs_idx_data_word_four
on evm.logs ("substring"(data, 97, 32));

create index evm_logs_idx_topic_two
on evm.logs ((topics[2]));

create index evm_logs_idx_topic_three
on evm.logs ((topics[3]));

create index evm_logs_idx_topic_four
on evm.logs ((topics[4]));
Loading