Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix index for ethflow_orders table #2836

Merged
merged 6 commits into from
Jul 29, 2024
Merged

Fix index for ethflow_orders table #2836

merged 6 commits into from
Jul 29, 2024

Conversation

sunce86
Copy link
Contributor

@sunce86 sunce86 commented Jul 25, 2024

Description

Previously index was created on a wrong table: "orders" instead of "ethflow_orders":
https://github.com/cowprotocol/services/blob/main/database/sql/V031__create_ethflow_orders.sql#L11

Should speed up the OPEN_ORDERS query, although not sure how much.

@sunce86 sunce86 self-assigned this Jul 25, 2024
@sunce86 sunce86 requested a review from a team as a code owner July 25, 2024 12:44
Copy link

Reminder: Please update the DB Readme.


Caused by:

Copy link
Contributor

@squadgazzz squadgazzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it a try locally, didn't really help(still have 3-4s to execute).

@squadgazzz
Copy link
Contributor

We have 2 identical indexes: user_valid_to and order_valid_to, right? One should be dropped.

@sunce86
Copy link
Contributor Author

sunce86 commented Jul 25, 2024

Relevant to #2831 (comment)

@sunce86
Copy link
Contributor Author

sunce86 commented Jul 29, 2024

We have 2 identical indexes: user_valid_to and order_valid_to, right? One should be dropped.

Dropped user_valid_to

@sunce86 sunce86 enabled auto-merge (squash) July 29, 2024 09:15
@sunce86 sunce86 merged commit 8e1e306 into main Jul 29, 2024
9 of 10 checks passed
@sunce86 sunce86 deleted the speed-up-open-orders branch July 29, 2024 09:20
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants