-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate
solvable_orders_after
query (#2954)
# Description A suggestion to unify SQL queries mentioned in the #2923 didn't work out. Postgres converts common table expressions into subqueries, which affects the performance. Also, with this approach, indexes cease to be utilized. As a result, it executes in 1.2-1.5s instead of ~200ms. Tried so far(nothing helped): - JOIN with CTE instead of using `WHERE IN (rowset)` - Use `WITH cte AS NOT MATERIALIZED` - Replace CTE with a subquery. - Convert CTE result into ARRAY(has the best performance, but still 2-3 times slower than separated queries). # Changes Revert to the separated queries that execute in ~200ms total. ## How to test Restored DB tests.
- Loading branch information
1 parent
ae3ef29
commit 2678178
Showing
3 changed files
with
304 additions
and
277 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
Oops, something went wrong.