explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Qm9f

Settings
# exclusive inclusive rows x rows loops node
1. 0.053 2,159.769 ↑ 886,110.0 30 1

WindowAgg (cost=170.48..397,783.78 rows=26,583,300 width=88) (actual time=2,144.182..2,159.769 rows=30 loops=1)

2. 0.174 2,159.716 ↑ 886,110.0 30 1

Merge Left Join (cost=170.48..251,575.63 rows=26,583,300 width=24) (actual time=2,139.693..2,159.716 rows=30 loops=1)

  • Merge Cond: ((generate_series('2020-09-01 00:00:00'::timestamp without time zone, '2020-09-30 00:00:00'::timestamp without time zone, '1 day'::interval)) = (date_trunc('day'::text, impressions_tb.date)))
3. 0.011 0.285 ↑ 33.3 30 1

Sort (cost=170.39..170.89 rows=1,000 width=16) (actual time=0.281..0.285 rows=30 loops=1)

  • Sort Key: (generate_series('2020-09-01 00:00:00'::timestamp without time zone, '2020-09-30 00:00:00'::timestamp without time zone, '1 day'::interval))
  • Sort Method: quicksort Memory: 26kB
4. 0.011 0.274 ↑ 33.3 30 1

Hash Left Join (cost=155.38..160.42 rows=1,000 width=16) (actual time=0.263..0.274 rows=30 loops=1)

  • Hash Cond: ((generate_series('2020-09-01 00:00:00'::timestamp without time zone, '2020-09-30 00:00:00'::timestamp without time zone, '1 day'::interval)) = anon_3.date)
5. 0.008 0.008 ↑ 33.3 30 1

ProjectSet (cost=0.00..1.50 rows=1,000 width=8) (actual time=0.003..0.008 rows=30 loops=1)

6. 0.000 0.000 ↑ 1.0 1 1

Result (cost=0.00..0.00 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=1)

7. 0.003 0.255 ↑ 8.4 8 1

Hash (cost=155.14..155.14 rows=67 width=16) (actual time=0.255..0.255 rows=8 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.001 0.252 ↑ 8.4 8 1

Subquery Scan on anon_3 (cost=154.61..155.14 rows=67 width=16) (actual time=0.240..0.252 rows=8 loops=1)

9. 0.012 0.251 ↑ 8.4 8 1

GroupAggregate (cost=154.61..154.94 rows=67 width=16) (actual time=0.240..0.251 rows=8 loops=1)

  • Group Key: (date_trunc('day'::text, likes_tb.created_at))
10. 0.017 0.239 ↑ 1.0 67 1

Sort (cost=154.61..154.64 rows=67 width=16) (actual time=0.235..0.239 rows=67 loops=1)

  • Sort Key: (date_trunc('day'::text, likes_tb.created_at))
  • Sort Method: quicksort Memory: 28kB
11. 0.222 0.222 ↑ 1.0 67 1

Index Scan using likes_tb_pkey on likes_tb (cost=0.08..154.20 rows=67 width=16) (actual time=0.017..0.222 rows=67 loops=1)

  • Index Cond: (id = ANY ('{162188,162198,162228,162246,162288,162339,162389,162441,162528,162583,162588,162643,162709,162722,162744,162785,162954,163012,163016,163053,163063,163080,163094,163140,163172,163195,163202,163304,163324,163360,163371,163389,163396,163419,163442,163561,163634,163645,163665,163701,163726,163806,163897,163901,163931,164001,164016,164017,164021,164027,164067,164093,164108,164174,164185,164212,164256,164267,164277,164298,164367,164441,164478,164483,164559,164610,164631}'::integer[]))
12. 555.867 2,159.257 ↑ 6,772.8 785 1

GroupAggregate (cost=0.09..153,046.03 rows=5,316,660 width=16) (actual time=0.373..2,159.257 rows=785 loops=1)

  • Group Key: date_trunc('day'::text, impressions_tb.date)
13. 1,603.390 1,603.390 ↑ 1.0 5,315,721 1

Index Scan using idx_impression_date on impressions_tb (cost=0.09..129,121.06 rows=5,316,660 width=16) (actual time=0.012..1,603.390 rows=5,315,721 loops=1)