serratus-bio / open-virome

monorepo for data explorer UI and APIs
http://openvirome.com/
GNU Affero General Public License v3.0
0 stars 0 forks source link

Use 'include' in filter-related indexes #73

Closed lukepereira closed 1 month ago

lukepereira commented 1 month ago

When adding filters with large results (>100k), queries are a bit slow even with a basic index.

By including accessions in the index, the query planner doesn't need a secondary step to retrieve accessions after finding matches in the indexed filter column. We may also need to adjust the query to remove any unnecessary columns

https://atlasgo.io/guides/postgres/included-columns