To annotate my discovery, this is the failing query: ``` SELECT h.id, h.url, h.title AS page_title, h.rev_host, h.visit_count, h.last_visit_date, null, null, null, null, null, null AS tags , h.frecency, h.hidden, h.guid, null, null, null FROM moz_places h WHERE 1 AND hidden = 0 AND last_visit_date NOTNULL AND ( EXISTS (SELECT 1 FROM moz_historyvisits WHERE place_id = h.id AND visit_date >= 1616968800000000 AND visit_date <= 1617055200000000 LIMIT 1) ) ORDER BY 6 DESC; ``` The LIMIT 1 in the subquery is somehow applied outside of it, possibly an optimization not working as expected.
Bug 1698592 Comment 7 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
To annotate my discovery, this is the failing query: ``` SELECT h.id, h.url, h.title AS page_title, h.rev_host, h.visit_count, h.last_visit_date, null, null, null, null, null, null AS tags , h.frecency, h.hidden, h.guid, null, null, null FROM moz_places h WHERE 1 AND hidden = 0 AND last_visit_date NOTNULL AND ( EXISTS (SELECT 1 FROM moz_historyvisits WHERE place_id = h.id AND visit_date >= 1616968800000000 AND visit_date <= 1617055200000000 LIMIT 1) ) ORDER BY 6 DESC; ``` The LIMIT 1 in the subquery is somehow applied outside of it, possibly an optimization not working as expected. This query is a bit ugly because it's built automatically by the history code, that would require some adjustments and rewrite.