explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8jKr

Settings
# exclusive inclusive rows x rows loops node
1. 501.758 7,116.870 ↑ 17.4 30 1

GroupAggregate (cost=928,259.99..928,276.92 rows=521 width=56) (actual time=6,149.097..7,116.870 rows=30 loops=1)

  • Group Key: (to_char(orders."timestamp", 'YYYY-MM-DD'::text))
2. 1,015.128 6,615.112 ↓ 210.9 109,882 1

Sort (cost=928,259.99..928,261.29 rows=521 width=36) (actual time=6,112.514..6,615.112 rows=109,882 loops=1)

  • Sort Key: (to_char(orders."timestamp", 'YYYY-MM-DD'::text))
  • Sort Method: external merge Disk: 2808kB
3. 1,011.990 5,599.984 ↓ 210.9 109,882 1

Hash Left Join (cost=3,902.25..928,236.48 rows=521 width=36) (actual time=12.318..5,599.984 rows=109,882 loops=1)

  • Hash Cond: ((orders.order_currency)::text = (currencies.currencycode)::text)
4. 1,000.783 4,587.665 ↓ 210.9 109,882 1

Nested Loop (cost=3,895.49..928,221.25 rows=521 width=16) (actual time=11.962..4,587.665 rows=109,882 loops=1)

5. 0.023 0.041 ↑ 1.0 1 1

Nested Loop (cost=0.00..3.04 rows=1 width=4) (actual time=0.027..0.041 rows=1 loops=1)

  • Join Filter: (campaigns.advertiser_id = advertiser.id)
6. 0.013 0.013 ↑ 1.0 1 1

Seq Scan on campaigns (cost=0.00..2.01 rows=1 width=8) (actual time=0.009..0.013 rows=1 loops=1)

  • Filter: (id = 1)
7. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on advertiser (cost=0.00..1.01 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1)

  • Filter: (network_id = 1)
8. 1,577.632 3,586.841 ↓ 210.9 109,882 1

Bitmap Heap Scan on orders (cost=3,895.49..928,213.00 rows=521 width=24) (actual time=11.921..3,586.841 rows=109,882 loops=1)

  • Recheck Cond: (("timestamp" >= '2019-04-15 00:00:00+02'::timestamp with time zone) AND ("timestamp" <= '2019-05-14 23:59:59+02'::timestamp with time zone))
  • Filter: ((campaign_id = 1) AND (((SubPlan 1))::text = 'click'::text))
  • Rows Removed by Filter: 1257
  • Heap Blocks: exact=21983
9. 8.707 8.707 ↓ 1.2 126,148 1

Bitmap Index Scan on orders_timestamp_idx (cost=0.00..3,895.36 rows=104,293 width=0) (actual time=8.707..8.707 rows=126,148 loops=1)

  • Index Cond: (("timestamp" >= '2019-04-15 00:00:00+02'::timestamp with time zone) AND ("timestamp" <= '2019-05-14 23:59:59+02'::timestamp with time zone))
10.          

SubPlan (forBitmap Heap Scan)

11. 1,444.807 2,000.502 ↑ 1.0 1 111,139

Limit (cost=0.42..8.44 rows=1 width=6) (actual time=0.014..0.018 rows=1 loops=111,139)

12. 555.695 555.695 ↑ 1.0 1 111,139

Index Scan using order_actions_id_seq2 on order_actions (cost=0.42..8.44 rows=1 width=6) (actual time=0.005..0.005 rows=1 loops=111,139)

  • Index Cond: (id = orders.order_actions_id)
13. 0.163 0.329 ↑ 1.0 34 1

Hash (cost=6.34..6.34 rows=34 width=4) (actual time=0.329..0.329 rows=34 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
14. 0.166 0.166 ↑ 1.0 34 1

Seq Scan on currencies (cost=0.00..6.34 rows=34 width=4) (actual time=0.009..0.166 rows=34 loops=1)