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

optimize txlist json rpc #2781

Merged
merged 8 commits into from
Oct 18, 2019
Merged

optimize txlist json rpc #2781

merged 8 commits into from
Oct 18, 2019

Conversation

ayrat555
Copy link
Contributor

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

  • optimize txlist json rpc

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.
@coveralls
Copy link

coveralls commented Oct 16, 2019

Pull Request Test Coverage Report for Build 1e5c892b-4878-48c8-a942-4adccd423f53

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 77.744%

Totals Coverage Status
Change from base Build 7d50efc0-c117-4ad8-82ca-64642d98176f: 0.6%
Covered Lines: 5341
Relevant Lines: 6870

💛 - Coveralls

Copy link
Contributor

@pasqu4le pasqu4le left a 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"
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

@vbaranov vbaranov merged commit 81b6513 into master Oct 18, 2019
@vbaranov vbaranov deleted the ab-fix-txlist-json-rpc branch October 18, 2019 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

txlist API timeout for addresses with large number of transactions
4 participants