Skip to content

Hotfix/match db indices #116

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Hotfix/match db indices #116

wants to merge 4 commits into from

Conversation

judgeaxl
Copy link

Improve performance on match queries for a given day by adding an index to start_date and also turn match_statistics and details to JSONB.

@judgeaxl judgeaxl self-assigned this Aug 19, 2024
@judgeaxl judgeaxl requested a review from einarth August 19, 2024 07:56
@judgeaxl
Copy link
Author

This will probably not get merged as:

  • Adding an index on start_time doesn't help, it's not used when the query runs on the date part only.
  • Adding the index and running the query on the date time range instead slows it down by a factor of 100. (!) Execution planner claims the index is used here, but it finds a lot more rows.
  • Removing the index and running on the date time range is similar to using date without an index.
  • Switching from json to jsonb and back for 200k rows took a second or so on the analytics DB.
  • Using jsonb had no significant effect on query time, although memory usage went down a little bit.

@einarth
Copy link

einarth commented Sep 2, 2024

Maybe check if a block range index performs better; dates like these are usually both ordered and clustered, so it's probably worth a shot.

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.

2 participants