Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
huh
select (
select
date_trunc('day', date_page_requested)
from
ua_user_page_requests
where
page_request_no = x.page_request_no
) as day,
x.*
from
page_request_breakdowns x
where
page_request_no in (
select
page_request_no
from
ua_user_page_requests
where
date_page_requested < '2010-11-18'
)
;
QUERY PLAN
--------------------------------------------------------------------------------------------------------
Hash Semi Join (cost=280052.24..323669309.99 rows=36284831 width=14)
Hash Cond: (x.page_request_no = public.ua_user_page_requests.page_request_no)
-> Seq Scan on page_request_breakdowns x (cost=0.00..570373.31 rows=36284831 width=14)
-> Hash (cost=209201.14..209201.14 rows=5668088 width=4)
-> Seq Scan on ua_user_page_requests (cost=0.00..209201.14 rows=5668088 width=4)
Filter: (date_page_requested < '2010-11-18 00:00:00'::timestamp without time zone)
SubPlan 1
-> Index Scan using pk_ua_user_page_requests on ua_user_page_requests (cost=0.00..8.88 rows=1 width=8)
Index Cond: (page_request_no = $0)
(9 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment