-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
optimize txlist json rpc #2781
optimize txlist json rpc #2781
Conversation
the query was sorted by transactions.block_number field which doesn't have db index (#2698). Now we will start sorting by blocks.number since transactions are joined with blocks anyway.
Pull Request Test Coverage Report for Build 1e5c892b-4878-48c8-a942-4adccd423f53
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question. Also I may be wrong but I think I tried sorting by block number myself at one point and postgres EXPLAIN
predicted a slightly worst performance.
Do you know if that was because of the ascending order? It is very possible that I don't remember correctly BTW
@@ -1189,7 +1189,7 @@ defmodule BlockScoutWeb.Etherscan do | |||
key: "sort", | |||
type: "string", | |||
description: | |||
"A string representing the order by block number direction. Defaults to ascending order. Available values: asc, desc" | |||
"A string representing the order by block number direction. Defaults to descending order. Available values: asc, desc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the descending order make a difference in performance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
fixes #1319
the query was sorted by transactions.block_number field
which doesn't have db
index (#2698).
Now we will start sorting by blocks.number since transactions are
joined with blocks anyway.
Changelog