You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimize run_by query to avoid full scan of experiment_crates table
The query plan was previously:
QUERY PLAN
|--SCAN TABLE experiment_crates
`--SEARCH TABLE experiments USING INDEX sqlite_autoindex_experiments_1 (name=?)
and now is:
QUERY PLAN
|--SEARCH TABLE experiments USING INDEX sqlite_autoindex_experiments_1 (name=?)
`--LIST SUBQUERY 2
|--SEARCH TABLE experiment_crates USING INDEX experiment_crates__experiment_skipped (experiment=? AND skipped=?)
`--LIST SUBQUERY 1
`--SCAN TABLE experiments
While the new query does search more, it does so in a way that is significantly
more efficient, as it can avoid scanning the whole experiment_crates table
(which is quite large).
0 commit comments