-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add new indexes & rework distinct (#449)
fix: Improve Indexes & Transactions query
- Loading branch information
Showing
4 changed files
with
29 additions
and
22 deletions.
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
pkg/storage/sqlstorage/migrates/20-optimized-indexes/postgres.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,8 @@ | ||
--statement | ||
CREATE INDEX IF NOT EXISTS postings_array_length_src ON "VAR_LEDGER_NAME".postings (jsonb_array_length(source)); | ||
--statement | ||
CREATE INDEX IF NOT EXISTS postings_array_length_dst ON "VAR_LEDGER_NAME".postings (jsonb_array_length(destination)); | ||
--statement | ||
CREATE INDEX IF NOT EXISTS accounts_array_length ON "VAR_LEDGER_NAME".accounts (jsonb_array_length(address_json)); | ||
--statement | ||
CREATE INDEX IF NOT EXISTS volumes_array_length ON "VAR_LEDGER_NAME".volumes (jsonb_array_length(account_json)); |
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