forked from matter-labs/zksync
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Optimize queries Signed-off-by: deniallugo <[email protected]> * Remove distincts Signed-off-by: deniallugo <[email protected]>
- Loading branch information
1 parent
ce0b36b
commit 680dfa8
Showing
5 changed files
with
69 additions
and
49 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
core/lib/storage/migrations/2022-07-05-090548_new-indexes/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
DROP INDEX IF EXISTS ix_tx_filters_tx_hash_address; | ||
CREATE INDEX IF NOT EXISTS tokens_symbol_index on public.tokens (symbol); | ||
DROP INDEX IF EXISTS tokens_symbol_lower_idx; | ||
DROP INDEX IF EXISTS ix_executed_transactions_failed_at; | ||
CREATE INDEX IF NOT EXISTS executed_transactions_tx_hash_idx | ||
ON "executed_transactions" USING hash (tx_hash); | ||
DROP INDEX IF EXISTS ix_prover_job_queue_job_type_last_block; | ||
DROP INDEX IF EXISTS aggregate_operations_action_type_to_block_true_idx; | ||
DROP INDEX IF EXISTS aggregate_operations_action_type_to_block_false_idx; | ||
DROP INDEX IF EXISTS aggregate_operations_action_type_to_block_idx; | ||
DROP INDEX IF EXISTS ix_prover_job_queue_job_status_updated_at ; |
11 changes: 11 additions & 0 deletions
11
core/lib/storage/migrations/2022-07-05-090548_new-indexes/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE INDEX IF NOT EXISTS ix_tx_filters_tx_hash_address ON public.tx_filters(tx_hash, address); | ||
DROP INDEX IF EXISTS tokens_symbol_index; | ||
DROP INDEX IF EXISTS tokens_symbol_idx; | ||
CREATE INDEX IF NOT EXISTS tokens_symbol_lower_idx ON public.tokens (lower(symbol)); | ||
CREATE INDEX IF NOT EXISTS ix_executed_transactions_failed_at ON executed_transactions ( created_at ) WHERE ( success = false ); | ||
DROP INDEX IF EXISTS executed_transactions_tx_hash_idx; | ||
CREATE INDEX IF NOT EXISTS ix_prover_job_queue_job_type_last_block ON prover_job_queue ( job_type, last_block ); | ||
CREATE INDEX IF NOT EXISTS ix_prover_job_queue_job_status_updated_at ON prover_job_queue ( job_status, updated_at ); | ||
CREATE INDEX IF NOT EXISTS aggregate_operations_action_type_to_block_true_idx ON public.aggregate_operations ( action_type, to_block ) where ( confirmed is distinct from false ); | ||
CREATE INDEX IF NOT EXISTS aggregate_operations_action_type_to_block_false_idx ON public.aggregate_operations ( action_type, to_block ) where ( confirmed is distinct from true ); | ||
CREATE INDEX IF NOT EXISTS aggregate_operations_action_type_to_block_idx ON public.aggregate_operations ( action_type, to_block ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters