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

db: runtime_events table: add indexes #333

Merged
merged 1 commit into from
Feb 27, 2023
Merged

Conversation

mitjat
Copy link
Contributor

@mitjat mitjat commented Feb 27, 2023

Based on a report from @lukaw3d where the following two queries timed out:

This PR adds an index for each of those two queries.

Already applied in staging and prod DBs. Queries are fast now.

Copy link
Collaborator

@pro-wh pro-wh left a comment

Choose a reason for hiding this comment

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

can we add primary key (runtime, round, tx_index) instead of the _round index?

edit: oh can't, because multiple events \:

Copy link
Collaborator

@Andrew7234 Andrew7234 left a comment

Choose a reason for hiding this comment

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

Lgtm!

storage/migrations/02_oasis_3_runtimes.up.sql Show resolved Hide resolved
@mitjat mitjat merged commit 30b5669 into main Feb 27, 2023
@mitjat mitjat deleted the mitjat/db-index-events branch February 27, 2023 19:51
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.

3 participants