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

Add index on workout_points.date #20

Open
simonw opened this issue Aug 20, 2021 · 2 comments
Open

Add index on workout_points.date #20

simonw opened this issue Aug 20, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Collaborator

simonw commented Aug 20, 2021

Sorting that by date makes sense for seeing most recent points, and my DB has 2.5m points in so it's an expensive sort!

@simonw simonw added the enhancement New feature or request label Aug 20, 2021
@simonw
Copy link
Collaborator Author

simonw commented Aug 20, 2021

Workaround:

sqlite-utils create-index healthkit.db workout_points -- -date

See https://sqlite-utils.datasette.io/en/stable/cli.html#creating-indexes

@simonw
Copy link
Collaborator Author

simonw commented Aug 20, 2021

Also on workout_points.workout_id to speed up queries to show all points in a specific workout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant