Uh oh!
There was an error while loading. Please reload this page.
[18.0][IMP] queue_job: add index for efficient autovacuum - #798
Conversation
OCA-git-bot
commented
Jun 25, 2025
Hi @guewen, |
Thanks @florentx! The index is scanned backwards because the query sorts by DESC and the index goes ASC. |
You're right @guewen . I've forced an # EXPLAIN ANALYZE SELECT id FROM"queue_job"WHERE (("date_done"<='2025-07-01'OR"date_cancelled"<='2025-07-01') AND"channel"='root.custom.purchase')
ORDER BY date_done, date_created LIMIT1000;
QUERY PLAN -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------Limit (cost=0.55..3756.69 rows=1000 width=20) (actual time=0.138..0.877 rows=1000 loops=1)
-> Index Scan using queue_job_channel_date_done_date_created_index on queue_job (cost=0.55..301651.84 rows=80309 width=20) (actual time=0.137..0.842 rows=1000 loops=1)
Index Cond: ((channel)::text='root.custom.purchase'::text)
Filter: ((date_done <='2025-07-01 00:00:00'::timestamp without time zone) OR (date_cancelled <='2025-07-01 00:00:00'::timestamp without time zone))
Planning Time: 0.200 ms
Execution Time: 0.918 ms
(6 rows) |
guewen
commented
Jun 25, 2025
/ocabot merge minor |
OCA-git-bot
commented
Jun 25, 2025
This PR looks fantastic, let's merge it! |
OCA-git-bot
commented
Jun 25, 2025
Congratulations, your PR was merged at 45dabc7. Thanks a lot for contributing to OCA. ❤️ |
This query was part of the slowest.
Before:
After: