Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

flusher: Add index on blocks table and swap order of primary key of validator_votes table #2319

Merged
merged 4 commits into from
Jul 29, 2020

Conversation

taobun
Copy link
Member

@taobun taobun commented Jul 28, 2020

Implementation details

  • Add index on some column that makes query slow.

Please ensure the following

requirements are met before submitting a pull request:

  • The pull request is targeted against the correct target branch
  • The pull request includes a description of the implementation/work done in detail.
  • You have added a relevant changelog entry to CHANGELOG_UNRELEASED.md
  • You have re-reviewed the files affected by the pull request (e.g. using the Files changed tab in the Github PR explorer)

If this PR doesn't need to be merged into v1.0.6 please remove this option:

  • The pull request has been cherry-picked to rc/1.0.6

@render
Copy link

render bot commented Jul 28, 2020

@taobun taobun changed the title flusher: Add index and swap order of primary key flusher: Add index on blocks table and swap order of primary key of validator_votes table Jul 28, 2020
@taobun taobun requested review from sorawit and Benzbeeb July 28, 2020 07:35
@@ -248,13 +248,13 @@ def Column(*args, **kwargs):
validator_votes = sa.Table(
"validator_votes",
metadata,
Column("block_height", sa.Integer, sa.ForeignKey("blocks.height"), primary_key=True),
Copy link
Member

Choose a reason for hiding this comment

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

I think what we need to do here is to force order of the primary key columns.

Copy link
Member

@sorawit sorawit left a comment

Choose a reason for hiding this comment

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

thanks

@taobun taobun merged commit 08288b6 into master Jul 29, 2020
@taobun taobun deleted the add-index branch July 29, 2020 13:08
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.

2 participants