From fe530b75a8f5bf6e2526ef2036fd65f6063b303d Mon Sep 17 00:00:00 2001 From: xiaodino Date: Mon, 19 Feb 2024 16:34:02 -0800 Subject: [PATCH] feat(relayer): add indexer in MySQL (#15927) --- ...8366658_alert_processed_blocks_block_height_index.sql | 9 +++++++++ ..._alert_processed_blocks_chain_id_event_name_index.sql | 9 +++++++++ ...lert_processed_blocks_block_height_chain_id_index.sql | 9 +++++++++ 3 files changed, 27 insertions(+) create mode 100644 packages/relayer/migrations/1708366658_alert_processed_blocks_block_height_index.sql create mode 100644 packages/relayer/migrations/1708366659_alert_processed_blocks_chain_id_event_name_index.sql create mode 100644 packages/relayer/migrations/1708366660_alert_processed_blocks_block_height_chain_id_index.sql diff --git a/packages/relayer/migrations/1708366658_alert_processed_blocks_block_height_index.sql b/packages/relayer/migrations/1708366658_alert_processed_blocks_block_height_index.sql new file mode 100644 index 0000000000..9be0342f42 --- /dev/null +++ b/packages/relayer/migrations/1708366658_alert_processed_blocks_block_height_index.sql @@ -0,0 +1,9 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE `processed_blocks` ADD INDEX `processed_blocks_block_height_index` (`block_height`); + +-- +goose StatementEnd +-- +goose Down +-- +goose StatementBegin +DROP INDEX processed_blocks_block_height_index on processed_blocks; +-- +goose StatementEnd \ No newline at end of file diff --git a/packages/relayer/migrations/1708366659_alert_processed_blocks_chain_id_event_name_index.sql b/packages/relayer/migrations/1708366659_alert_processed_blocks_chain_id_event_name_index.sql new file mode 100644 index 0000000000..e7e855384e --- /dev/null +++ b/packages/relayer/migrations/1708366659_alert_processed_blocks_chain_id_event_name_index.sql @@ -0,0 +1,9 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE `processed_blocks` ADD INDEX `processed_blocks_chain_id_event_name_index` (`chain_id`, `event_name`); + +-- +goose StatementEnd +-- +goose Down +-- +goose StatementBegin +DROP INDEX processed_blocks_chain_id_event_name_index on processed_blocks; +-- +goose StatementEnd \ No newline at end of file diff --git a/packages/relayer/migrations/1708366660_alert_processed_blocks_block_height_chain_id_index.sql b/packages/relayer/migrations/1708366660_alert_processed_blocks_block_height_chain_id_index.sql new file mode 100644 index 0000000000..9f6f22dd4d --- /dev/null +++ b/packages/relayer/migrations/1708366660_alert_processed_blocks_block_height_chain_id_index.sql @@ -0,0 +1,9 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE `processed_blocks` ADD INDEX `processed_blocks_block_height_chain_id_index` (`block_height`, `chain_id`); + +-- +goose StatementEnd +-- +goose Down +-- +goose StatementBegin +DROP INDEX processed_blocks_block_height_chain_id_index on processed_blocks; +-- +goose StatementEnd \ No newline at end of file