collect: small optimization on garbage collect
This changes a query like: SELECT date FROM user WHERE reported = 1 AND date != '2020-04-13' AND date != '2020-04-12' AND date != '2020-04-11' AND date != '2020-04-10' AND date != '2020-04-09' AND date != '2020-04-08' AND date != '2020-04-07' AND date != '2020-04-06' AND date != '2020-04-05' AND date != '2020-04-04' AND date != '2020-04-03' AND date != '2020-04-02' AND date != '2020-04-01' AND date != '2020-03-31' AND date != '2020-03-30' LIMIT 1 EXPLAIN QUERY PLAN ... 0|0|0|SCAN TABLE user USING COVERING INDEX user_date_reported_index which took ~3 seconds on a 1.5Go collector.db into: SELECT date FROM user WHERE reported = 1 AND (date < '2020-03-30' OR date > '2020-04-13') LIMIT 1 EXPLAIN QUERY PLAN ... 0|0|0|SEARCH TABLE user USING COVERING INDEX user_date_reported_index (date<?) 0|0|0|SEARCH TABLE user USING COVERING INDEX user_date_reported_index (date>?) which is instant.
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
External | |||||||||
passed |
#68834
external
|
SlapOS.Eggs.UnitTest-Master.Python2 |
00:40:49
|
||||||
passed |
#68851
external
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:30:49
|
||||||
failed |
#68783
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python2 |
00:32:34
|
||||||
failed |
#68805
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python2 |
|
||||||
passed |
#68794
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:34:13
|
||||||