-
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.
fix(api): SQL: use = instead of ANY where possible in events-related …
…queries (#1346) We have the following request: ``` FROM events WHERE (miniblock_number >= $6) AND (miniblock_number <= $7) AND (address = ANY($1)) AND (topic1 = ANY($2)) AND (topic2 = ANY($3)) AND (topic3 = ANY($4)) ORDER BY miniblock_number ASC, event_index_in_block ASC ``` currently regardless of amount of elements in every filter, we apply ANY clause. This PR changes this so that if there is exactly one element, `ANY` is replaced with `=`. **WHY** we have a hypotesis that this will significantly improve DB performance of this query
- Loading branch information
1 parent
dcb52bb
commit ce39dff
Showing
1 changed file
with
139 additions
and
19 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