explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GAYD

Settings
# exclusive inclusive rows x rows loops node
1. 0.046 1,248.475 ↑ 34.7 31 1

WindowAgg (cost=51,973.30..51,980.31 rows=1,075 width=88) (actual time=1,246.702..1,248.475 rows=31 loops=1)

2. 0.016 1,248.429 ↑ 34.7 31 1

Merge Left Join (cost=51,973.30..51,974.40 rows=1,075 width=24) (actual time=1,246.618..1,248.429 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.010 0.690 ↑ 34.7 31 1

Sort (cost=450.97..451.51 rows=1,075 width=16) (actual time=0.688..0.690 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 0.680 ↑ 34.7 31 1

Hash Left Join (cost=435.10..440.15 rows=1,075 width=16) (actual time=0.667..0.680 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.009 ↑ 32.3 31 1

ProjectSet (cost=0.00..1.50 rows=1,000 width=8) (actual time=0.003..0.009 rows=31 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.006 0.659 ↑ 7.2 30 1

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

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

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

9. 0.035 0.649 ↑ 7.2 30 1

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

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

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

  • Sort Key: (date_trunc('day'::text, likes_tb.created_at))
  • Sort Method: quicksort Memory: 35kB
11. 0.559 0.559 ↑ 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.019..0.559 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. 1.303 1,247.723 ↓ 31.0 31 1

GroupAggregate (cost=51,522.32..51,522.33 rows=1 width=16) (actual time=1,245.926..1,247.723 rows=31 loops=1)

  • Group Key: (date_trunc('day'::text, impressions_tb.date))
13. 3.097 1,246.420 ↓ 10,744.0 10,744 1

Sort (cost=51,522.32..51,522.32 rows=1 width=16) (actual time=1,245.882..1,246.420 rows=10,744 loops=1)

  • Sort Key: (date_trunc('day'::text, impressions_tb.date))
  • Sort Method: quicksort Memory: 888kB
14. 0.000 1,243.323 ↓ 10,744.0 10,744 1

Nested Loop (cost=1,000.09..51,522.32 rows=1 width=16) (actual time=382.383..1,243.323 rows=10,744 loops=1)

15. 313.490 710.826 ↓ 182,549.0 182,549 1

Gather (cost=1,000.00..51,518.23 rows=1 width=12) (actual time=382.229..710.826 rows=182,549 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
16. 397.336 397.336 ↓ 91,274.0 91,274 2 / 2

Parallel Seq Scan on impressions_tb (cost=0.00..50,518.13 rows=1 width=12) (actual time=370.820..397.336 rows=91,274 loops=2)

  • Filter: ((date > '2020-08-01 00:00:00'::timestamp without time zone) AND (date < '2020-09-01 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 2,566,491
17. 547.647 547.647 ↓ 0.0 0 182,549

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

  • Index Cond: (id = impressions_tb.job_id)
  • Filter: ((source)::text = 'Time4Change'::text)
  • Rows Removed by Filter: 1
Planning time : 0.792 ms
Execution time : 1,256.699 ms