From 15e9c1339509f15589012baa94c227c2415cdaaa Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Sat, 18 May 2024 13:46:36 -0700 Subject: [PATCH] feat(guardian-prover-health-check): add indexes (#17245) --- ...51006_alter_health_checks_recovered_address_index.sql | 9 +++++++++ ..._health_checks_recovered_address_created_at_index.sql | 9 +++++++++ .../1666651008_alter_signed_blocks_address_index.sql | 9 +++++++++ .../1666651009_alter_signed_blocks_address_block_id.sql | 9 +++++++++ ...1010_alter_startups_guardian_prover_address_index.sql | 9 +++++++++ 5 files changed, 45 insertions(+) create mode 100644 packages/guardian-prover-health-check/migrations/1666651006_alter_health_checks_recovered_address_index.sql create mode 100644 packages/guardian-prover-health-check/migrations/1666651007_alter_health_checks_recovered_address_created_at_index.sql create mode 100644 packages/guardian-prover-health-check/migrations/1666651008_alter_signed_blocks_address_index.sql create mode 100644 packages/guardian-prover-health-check/migrations/1666651009_alter_signed_blocks_address_block_id.sql create mode 100644 packages/guardian-prover-health-check/migrations/1666651010_alter_startups_guardian_prover_address_index.sql diff --git a/packages/guardian-prover-health-check/migrations/1666651006_alter_health_checks_recovered_address_index.sql b/packages/guardian-prover-health-check/migrations/1666651006_alter_health_checks_recovered_address_index.sql new file mode 100644 index 00000000000..bd4130e6d37 --- /dev/null +++ b/packages/guardian-prover-health-check/migrations/1666651006_alter_health_checks_recovered_address_index.sql @@ -0,0 +1,9 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE `health_checks` ADD INDEX `health_checks_recovered_address_index` (`recovered_address`); + +-- +goose StatementEnd +-- +goose Down +-- +goose StatementBegin +DROP INDEX health_checks_recovered_address_index on health_checks; +-- +goose StatementEnd diff --git a/packages/guardian-prover-health-check/migrations/1666651007_alter_health_checks_recovered_address_created_at_index.sql b/packages/guardian-prover-health-check/migrations/1666651007_alter_health_checks_recovered_address_created_at_index.sql new file mode 100644 index 00000000000..c177009f7e5 --- /dev/null +++ b/packages/guardian-prover-health-check/migrations/1666651007_alter_health_checks_recovered_address_created_at_index.sql @@ -0,0 +1,9 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE `health_checks` ADD INDEX `health_checks_recovered_address_created_at_index` (`recovered_address`, `created_at`); + +-- +goose StatementEnd +-- +goose Down +-- +goose StatementBegin +DROP INDEX health_checks_recovered_address_created_at_index on health_checks; +-- +goose StatementEnd diff --git a/packages/guardian-prover-health-check/migrations/1666651008_alter_signed_blocks_address_index.sql b/packages/guardian-prover-health-check/migrations/1666651008_alter_signed_blocks_address_index.sql new file mode 100644 index 00000000000..46273c487d0 --- /dev/null +++ b/packages/guardian-prover-health-check/migrations/1666651008_alter_signed_blocks_address_index.sql @@ -0,0 +1,9 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE `signed_blocks` ADD INDEX `signed_blocks_recovered_address_index` (`recovered_address`); + +-- +goose StatementEnd +-- +goose Down +-- +goose StatementBegin +DROP INDEX signed_blocks_recovered_address_index on signed_blocks; +-- +goose StatementEnd diff --git a/packages/guardian-prover-health-check/migrations/1666651009_alter_signed_blocks_address_block_id.sql b/packages/guardian-prover-health-check/migrations/1666651009_alter_signed_blocks_address_block_id.sql new file mode 100644 index 00000000000..20852d1b884 --- /dev/null +++ b/packages/guardian-prover-health-check/migrations/1666651009_alter_signed_blocks_address_block_id.sql @@ -0,0 +1,9 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE `signed_blocks` ADD INDEX `signed_blocks_recovered_address_block_id_index` (`recovered_address`, `block_id`); + +-- +goose StatementEnd +-- +goose Down +-- +goose StatementBegin +DROP INDEX signed_blocks_recovered_address_block_id_index on signed_blocks; +-- +goose StatementEnd diff --git a/packages/guardian-prover-health-check/migrations/1666651010_alter_startups_guardian_prover_address_index.sql b/packages/guardian-prover-health-check/migrations/1666651010_alter_startups_guardian_prover_address_index.sql new file mode 100644 index 00000000000..76e58bf9513 --- /dev/null +++ b/packages/guardian-prover-health-check/migrations/1666651010_alter_startups_guardian_prover_address_index.sql @@ -0,0 +1,9 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE `startups` ADD INDEX `startups_guardian_prover_address_index` (`guardian_prover_address`); + +-- +goose StatementEnd +-- +goose Down +-- +goose StatementBegin +DROP INDEX startups_guardian_prover_address_index on startups; +-- +goose StatementEnd