explain.depesz.com

A tool for finding a real cause for slow queries.

Result: IMG

options
exclusive inclusive rows x rows loops node
30.724 1184.236 ↑ 109.6 101 1

GroupAggregate (cost=55042.22..56288.30 rows=11072 width=35) (actual time=1106.923..1184.236 rows=101 loops=1)

452.746 1153.512 ↑ 1.1 30701 1

Sort (cost=55042.22..55123.17 rows=32379 width=35) (actual time=1106.275..1153.512 rows=30701 loops=1)

  • Sort Key: a14.month_id, a12.name
  • Sort Method: external merge Disk: 1264kB
62.812 700.766 ↑ 1.1 30701 1

Hash Join (cost=40337.07..51731.08 rows=32379 width=35) (actual time=509.944..700.766 rows=30701 loops=1)

  • Hash Cond: (a11.market_id = a12.market_id)
77.529 439.842 ↑ 1.1 30701 1

Hash Join (cost=23873.06..31955.97 rows=32379 width=17) (actual time=304.349..439.842 rows=30701 loops=1)

  • Hash Cond: (a11.selection_id = a13.selection_id)
58.131 58.490 ↑ 1.1 30701 1

Merge Join (cost=32.04..4383.11 rows=32540 width=24) (actual time=0.442..58.490 rows=30701 loops=1)

  • Merge Cond: (a14.day_id = (timezone('Europe/Stockholm'::text, a11.created_at))::date)
  • -> Index Scan using placement_parts_adjusted_timezone_idx on placement_parts_adjusted a11 (cost=0.
0.359 0.359 ↓ 1.0 489 1

Sort (cost=31.74..32.93 rows=473 width=8) (actual time=0.320..0.359 rows=489 loops=1)

  • Sort Key: a14.day_id
  • Sort Method: quicksort Memory: 48kB
  • -> Seq Scan on dim_day a14 (cost=0.00..10.73 rows=473 width=8) (actual time=0.004..0.126 row
  • Index Cond: (((timezone('Europe/Stockholm'::text, created_at))::date >= to_date('2012-01-01'::
303.823 303.823 ↓ 1.0 572453 1

Hash (cost=13938.33..13938.33 rows=569655 width=9) (actual time=303.823..303.823 rows=572453 loops=1)

  • Buckets: 4096 Batches: 32 Memory Usage: 848kB
  • -> Seq Scan on selections a13 (cost=0.00..13938.33 rows=569655 width=9) (actual time=0.013..175.59
  • Filter: ((CASE WHEN live THEN 'true'::text ELSE 'false'::text END = 'true'::text) OR (CASE WHE
198.112 198.112 ↑ 1.0 339768 1

Hash (cost=9891.67..9891.67 rows=339867 width=26) (actual time=198.112..198.112 rows=339768 loops=1)

  • Buckets: 2048 Batches: 32 Memory Usage: 645kB
  • -> Seq Scan on markets a12 (cost=0.00..9891.67 rows=339867 width=26) (actual time=0.011..95.937 rows=339