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 token token transfers query #2769

Merged
merged 3 commits into from
Oct 16, 2019

Conversation

ayrat555
Copy link
Contributor

@ayrat555 ayrat555 commented Oct 9, 2019

Motivation

the longes part of the query is ordering.
Removing the order clause from the query makes a
query much faster. It's because by default indexes
are ordered in ASC order

part of #2644

Update: I added this migration on stg. CryptoKitties token transfers don't fail anymore. The longest part is counters now
tokens/0x06012c8cf97bead5deae237070f9587f8e7a266d/token_transfers

Changelog

  • optimize token token transfers query

the longes part of the query is ordering.
Removing order clause from the query makes a
query much faster. It's because by default indexes
are ordered in ASC order
@coveralls
Copy link

coveralls commented Oct 9, 2019

Pull Request Test Coverage Report for Build 640ae303-7405-468b-9b8f-a25e63b4fc58

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 77.516%

Files with Coverage Reduction New Missed Lines %
apps/block_scout_web/lib/block_scout_web/controllers/chain/market_history_chart_controller.ex 2 71.43%
Totals Coverage Status
Change from base Build ed1f6586-be28-4ce7-aad1-e283ea55d6a6: -0.03%
Covered Lines: 5323
Relevant Lines: 6867

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 26273762-4565-4783-b43f-317d7eea19c4

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 77.812%

Totals Coverage Status
Change from base Build 99c48a74-0dd3-46f3-92ca-8200a7a5f07d: 0.0%
Covered Lines: 5320
Relevant Lines: 6837

💛 - Coveralls

Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

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

@ayrat555 approved since this PR partially fixes the issue for some tokens. However, there are examples of tokens' pages still exist, that do not load token transfers:
/tokens/0x6fb3e0a217407efff7ca062d46c26e5d60a14d69/token_transfers
/tokens/0x77fe30b2cf39245267c0a5084b66a560f1cf9e1f/token_transfers

@vbaranov vbaranov merged commit 9718717 into master Oct 16, 2019
@vbaranov vbaranov deleted the ab-optimize-token-token-transfers-query branch October 16, 2019 13:57
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.

4 participants