windrim/open-sunshine

Suggestion: add some indexes to columns in records

Opened this issue · 0 comments

It looks like the main https://opensunshine.herokuapp.com/main/records table has a FTS index but no column indexes.

It would be good to have indexes on sector_id and employer_id and job_id to help speed up queries (and facet queries) like this one: https://opensunshine.herokuapp.com/main/records?_sort=rowid&employer_id__exact=6

One easy way to do this is with https://sqlite-utils.datasette.io/en/stable/cli.html#adding-indexes-for-all-foreign-keys - run sqlite-utils index-foreign-keys main.db