Sort (cost=285.04..285.05 rows=6 width=56) (actual time=0.270..0.273 rows=4 loops=1) |
Output: c.name, (count(*)), (min(temp1.date1)), (max(l.date1)), temp1.date1, l.date1 |
Sort Key: temp1.date1, (count(*)) DESC, c.name |
Sort Method: quicksort Memory: 25kB |
Buffers: shared hit=3 |
-> GroupAggregate (cost=284.79..284.96 rows=6 width=56) (actual time=0.258..0.264 rows=4 loops=1) |
Output: c.name, count(*), min(temp1.date1), max(l.date1), temp1.date1, l.date1 |
Group Key: c.name, temp1.date1, l.date1 |
Buffers: shared hit=3 |
-> Sort (cost=284.79..284.81 rows=6 width=40) (actual time=0.252..0.255 rows=12 loops=1) |
Output: c.name, temp1.date1, l.date1 |
Sort Key: c.name, temp1.date1, l.date1 |
Sort Method: quicksort Memory: 25kB |
Buffers: shared hit=3 |
-> Hash Right Join (cost=257.68..284.72 rows=6 width=40) (actual time=0.227..0.242 rows=12 loops=1) |
Output: c.name, temp1.date1, l.date1 |
Hash Cond: (c.name = temp1.name) |
Join Filter: ((c.id >= temp1.id) AND (c.id <= l.id)) |
Rows Removed by Join Filter: 16 |
Buffers: shared hit=3 |
-> Seq Scan on public.cars c (cost=0.00..22.00 rows=1200 width=36) (actual time=0.006..0.008 rows=23 loops=1) |
Output: c.id, c.name, c.date1 |
Buffers: shared hit=1 |
-> Hash (cost=257.60..257.60 rows=6 width=48) (actual time=0.207..0.209 rows=4 loops=1) |
Output: temp1.date1, temp1.name, temp1.id, l.date1, l.id |
Buckets: 1024 Batches: 1 Memory Usage: 9kB |
Buffers: shared hit=2 |
-> Nested Loop Left Join (cost=166.75..257.60 rows=6 width=48) (actual time=0.158..0.202 rows=4 loops=1) |
Output: temp1.date1, temp1.name, temp1.id, l.date1, l.id |
Join Filter: ((row_number() OVER (?)) = l.rn) |
Rows Removed by Join Filter: 12 |
Buffers: shared hit=2 |
-> WindowAgg (cost=83.37..128.46 rows=6 width=52) (actual time=0.047..0.066 rows=4 loops=1) |
Output: temp1.id, temp1.name, temp1.date1, NULL::integer, row_number() OVER (?) |
Buffers: shared hit=1 |
-> Subquery Scan on temp1 (cost=83.37..128.37 rows=6 width=40) (actual time=0.033..0.055 rows=4 loops=1) |
Output: temp1.id, temp1.name, temp1.date1 |
Filter: (temp1.is_first = 1) |
Rows Removed by Filter: 19 |
Buffers: shared hit=1 |
-> WindowAgg (cost=83.37..113.37 rows=1200 width=44) (actual time=0.027..0.051 rows=23 loops=1) |
Output: cars.id, cars.name, cars.date1, CASE WHEN (((lag(cars.name, 1) OVER (?) <> cars.name) OR (lag(cars.name, 1) OVER (?) IS NULL)) AND (lead(cars.name, 1) OVER (?) = cars.name)) THEN 1 ELSE 0 END |
Buffers: shared hit=1 |
-> Sort (cost=83.37..86.37 rows=1200 width=40) (actual time=0.017..0.019 rows=23 loops=1) |
Output: cars.id, cars.name, cars.date1 |
Sort Key: cars.id |
Sort Method: quicksort Memory: 26kB |
Buffers: shared hit=1 |
-> Seq Scan on public.cars (cost=0.00..22.00 rows=1200 width=40) (actual time=0.007..0.009 rows=23 loops=1) |
Output: cars.id, cars.name, cars.date1 |
Buffers: shared hit=1 |
-> Materialize (cost=83.37..128.55 rows=6 width=16) (actual time=0.027..0.033 rows=4 loops=4) |
Output: l.date1, l.rn, l.id |
Buffers: shared hit=1 |
-> Subquery Scan on l (cost=83.37..128.52 rows=6 width=16) (actual time=0.057..0.077 rows=4 loops=1) |
Output: l.date1, l.rn, l.id |
Buffers: shared hit=1 |
-> WindowAgg (cost=83.37..128.46 rows=6 width=52) (actual time=0.057..0.075 rows=4 loops=1) |
Output: temp2.id, NULL::text, temp2.date1, NULL::integer, row_number() OVER (?) |
Buffers: shared hit=1 |
-> Subquery Scan on temp2 (cost=83.37..128.37 rows=6 width=8) (actual time=0.041..0.064 rows=4 loops=1) |
Output: temp2.id, temp2.date1 |
Filter: (temp2.is_last = 1) |
Rows Removed by Filter: 19 |
Buffers: shared hit=1 |
-> WindowAgg (cost=83.37..113.37 rows=1200 width=44) (actual time=0.031..0.061 rows=23 loops=1) |
Output: cars_1.id, NULL::text, cars_1.date1, CASE WHEN (((lead(cars_1.name, 1) OVER (?) <> cars_1.name) OR (lead(cars_1.name, 1) OVER (?) IS NULL)) AND (lag(cars_1.name, 1) OVER (?) = cars_1.name)) THEN 1 ELSE 0 END |
Buffers: shared hit=1 |
-> Sort (cost=83.37..86.37 rows=1200 width=40) (actual time=0.022..0.024 rows=23 loops=1) |
Output: cars_1.id, cars_1.date1, cars_1.name |
Sort Key: cars_1.id |
Sort Method: quicksort Memory: 26kB |
Buffers: shared hit=1 |
-> Seq Scan on public.cars cars_1 (cost=0.00..22.00 rows=1200 width=40) (actual time=0.007..0.010 rows=23 loops=1) |
Output: cars_1.id, cars_1.date1, cars_1.name |
Buffers: shared hit=1 |
Planning Time: 0.292 ms |
Execution Time: 0.428 ms |