Skip to content

Hotfix/match db indices#116

Open
judgeaxl wants to merge 4 commits intodevelopfrom
hotfix/match-db-indices
Open

Hotfix/match db indices#116
judgeaxl wants to merge 4 commits intodevelopfrom
hotfix/match-db-indices

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