healthkit-to-sqlite
healthkit-to-sqlite copied to clipboard
Add index on workout_points.date
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!
Workaround:
sqlite-utils create-index healthkit.db workout_points -- -date
See https://sqlite-utils.datasette.io/en/stable/cli.html#creating-indexes
Also on workout_points.workout_id
to speed up queries to show all points in a specific workout.