explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CNZR

Settings
# exclusive inclusive rows x rows loops node
1. 0.050 625.357 ↑ 186.0 31 1

WindowAgg (cost=50,588.59..50,717.18 rows=5,767 width=88) (actual time=624.474..625.357 rows=31 loops=1)

2. 0.017 625.307 ↑ 186.0 31 1

Merge Left Join (cost=50,588.59..50,685.46 rows=5,767 width=24) (actual time=624.407..625.307 rows=31 loops=1)

  • Merge Cond: ((generate_series('2020-08-01 00:00:00'::timestamp without time zone, '2020-08-31 00:00:00'::timestamp without time zone, '1 day'::interval)) = (date_trunc('day'::text, impressions_tb.date)))
3. 0.009 4.279 ↑ 34.7 31 1

Sort (cost=450.97..451.51 rows=1,075 width=16) (actual time=4.277..4.279 rows=31 loops=1)

  • Sort Key: (generate_series('2020-08-01 00:00:00'::timestamp without time zone, '2020-08-31 00:00:00'::timestamp without time zone, '1 day'::interval))
  • Sort Method: quicksort Memory: 26kB
4. 0.012 4.270 ↑ 34.7 31 1

Hash Left Join (cost=435.10..440.15 rows=1,075 width=16) (actual time=4.257..4.270 rows=31 loops=1)

  • Hash Cond: ((generate_series('2020-08-01 00:00:00'::timestamp without time zone, '2020-08-31 00:00:00'::timestamp without time zone, '1 day'::interval)) = anon_3.date)
5. 0.009 0.010 ↑ 32.3 31 1

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

6. 0.001 0.001 ↑ 1.0 1 1

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

7. 0.007 4.248 ↑ 7.2 30 1

Hash (cost=434.35..434.35 rows=215 width=16) (actual time=4.248..4.248 rows=30 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
8. 0.004 4.241 ↑ 7.2 30 1

Subquery Scan on anon_3 (cost=432.63..434.35 rows=215 width=16) (actual time=4.196..4.241 rows=30 loops=1)

9. 0.036 4.237 ↑ 7.2 30 1

GroupAggregate (cost=432.63..433.71 rows=215 width=16) (actual time=4.196..4.237 rows=30 loops=1)

  • Group Key: (date_trunc('day'::text, likes_tb.created_at))
10. 0.053 4.201 ↑ 1.0 215 1

Sort (cost=432.63..432.74 rows=215 width=16) (actual time=4.191..4.201 rows=215 loops=1)

  • Sort Key: (date_trunc('day'::text, likes_tb.created_at))
  • Sort Method: quicksort Memory: 35kB
11. 4.148 4.148 ↑ 1.0 215 1

Index Scan using likes_tb_pkey on likes_tb (cost=0.08..430.96 rows=215 width=16) (actual time=0.633..4.148 rows=215 loops=1)

  • Index Cond: (id = ANY ('{155147,155150,155224,155269,155294,155307,155377,155392,155420,155451,155462,155533,155548,155550,155583,155604,155653,155680,155688,155714,155745,155787,155793,155826,155846,155859,155934,155943,155983,155992,156109,156140,156150,156166,156204,156433,156508,156537,156617,156647,156679,156683,156704,156727,156756,156799,156806,156811,156852,156877,156931,156954,156970,157125,157168,157247,157271,157281,157285,157365,157470,157549,157611,157645,157654,157657,157676,157720,157735,157749,157766,157789,157796,157812,157826,158056,158095,158169,158202,158324,158404,158415,158455,158468,158502,158522,158541,158581,158622,158623,158632,158697,158703,158718,158729,158736,158745,158752,158769,159032,159049,159053,159227,159268,159284,159293,159323,159360,159413,159427,159458,159466,159498,159547,159566,159584,159588,159601,159681,159707,159718,159731,159739,159756,159774,159822,159841,159859,159882,159918,159926,159931,159938,159955,159990,160042,160049,160055,160074,160129,160133,160139,160168,160173,160178,160234,160277,160278,160319,160357,160384,160478,160504,160517,160529,160554,160603,160662,160682,160701,160706,160726,160743,160749,160769,160774,160795,160824,160841,160855,160872,160942,160969,160982,160995,161024,161054,161077,161081,161088,161147,161225,161244,161289,161301,161336,161378,161383,161393,161402,161424,161447,161475,161520,161523,161527,161626,161730,161741,161788,161792,161858,161882,161886,161925,161939,161956,161985,162004,162017,162028,162033,162085,162092,162096}'::integer[]))
12. 0.000 621.011 ↑ 34.6 31 1

Finalize GroupAggregate (cost=50,137.61..50,212.35 rows=1,073 width=16) (actual time=620.126..621.011 rows=31 loops=1)

  • Group Key: (date_trunc('day'::text, impressions_tb.date))
13. 21.008 639.349 ↑ 10.2 62 1

Gather Merge (cost=50,137.61..50,207.97 rows=631 width=16) (actual time=620.078..639.349 rows=62 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
14. 0.673 618.341 ↑ 20.4 31 2 / 2

Partial GroupAggregate (cost=49,137.61..49,140.76 rows=631 width=16) (actual time=617.424..618.341 rows=31 loops=2)

  • Group Key: (date_trunc('day'::text, impressions_tb.date))
15. 1.639 617.668 ↓ 8.5 5,372 2 / 2

Sort (cost=49,137.61..49,137.92 rows=631 width=16) (actual time=617.401..617.668 rows=5,372 loops=2)

  • Sort Key: (date_trunc('day'::text, impressions_tb.date))
  • Sort Method: quicksort Memory: 443kB
16. 58.494 616.029 ↓ 8.5 5,372 2 / 2

Nested Loop (cost=0.17..49,131.74 rows=631 width=16) (actual time=0.926..616.029 rows=5,372 loops=2)

17. 101.162 101.162 ↓ 5.4 91,274 2 / 2

Parallel Index Scan using idx_impression_date_2 on impressions_tb (cost=0.09..471.98 rows=16,856 width=12) (actual time=0.043..101.162 rows=91,274 loops=2)

  • Index Cond: ((date > '2020-08-01 00:00:00'::timestamp without time zone) AND (date < '2020-09-01 00:00:00'::timestamp without time zone))
18. 456.373 456.373 ↓ 0.0 0 182,549 / 2

Index Scan using job_tb_pkey on job_tb (cost=0.09..2.89 rows=1 width=4) (actual time=0.005..0.005 rows=0 loops=182,549)

  • Index Cond: (id = impressions_tb.job_id)
  • Filter: ((source)::text = 'Time4Change'::text)
  • Rows Removed by Filter: 1