-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(db): Add "contains" clause for get_logs (#1384)
## What ❔ Add "contains" clause for get_logs and gin index that should be used by this clause. ## Why ❔ Improve query performance ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `zk spellcheck`. - [ ] Linkcheck has been run via `zk linkcheck`.
- Loading branch information
1 parent
58576d1
commit e62ae32
Showing
3 changed files
with
155 additions
and
81 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
core/lib/dal/migrations/20240307135715_events_gin_index.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 @@ | ||
DROP INDEX IF EXISTS events_gin_index; |
7 changes: 7 additions & 0 deletions
7
core/lib/dal/migrations/20240307135715_events_gin_index.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,7 @@ | ||
CREATE INDEX IF NOT EXISTS events_gin_index on events using gin ((array [ | ||
address, | ||
'\x01'::bytea || topic1, | ||
'\x02'::bytea || topic2, | ||
'\x03'::bytea || topic3, | ||
'\x04'::bytea || topic4 | ||
])); |
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