explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dBPA

Settings
# exclusive inclusive rows x rows loops node
1. 890.325 693,988.862 ↑ 75.4 7,568 1

GroupAggregate (cost=1,047,621.43..1,437,402.95 rows=570,699 width=92) (actual time=693,059.112..693,988.862 rows=7,568 loops=1)

  • Group Key: f.name, (date_trunc('day'::text, timezone('Europe/Moscow'::text, o.created_at)))
  • Group Key: f.name
  • Group Key: ()
  • Sort Key: (date_trunc('day'::text, timezone('Europe/Moscow'::text, o.created_at)))
  • Group Key: (date_trunc('day'::text, timezone('Europe/Moscow'::text, o.created_at)))
2. 526.108 693,098.537 ↑ 1.2 378,861 1

Sort (cost=1,047,621.43..1,048,787.59 rows=466,465 width=92) (actual time=693,059.065..693,098.537 rows=378,861 loops=1)

  • Sort Key: f.name, (date_trunc('day'::text, timezone('Europe/Moscow'::text, o.created_at)))
  • Sort Method: quicksort Memory: 69233kB
3. 469,985.168 692,572.429 ↑ 1.2 378,861 1

Nested Loop Left Join (cost=314.70..1,003,700.46 rows=466,465 width=92) (actual time=6.119..692,572.429 rows=378,861 loops=1)

  • Join Filter: (oa.order_id = o.id)
  • Rows Removed by Join Filter: 6390989346
4. 104.539 953.576 ↑ 1.2 378,861 1

Hash Left Join (cost=314.27..994,362.71 rows=466,465 width=91) (actual time=0.955..953.576 rows=378,861 loops=1)

  • Hash Cond: (o.cancelation_reason_id = cr.id)
5. 118.757 849.030 ↑ 1.2 378,861 1

Hash Join (cost=311.75..989,845.12 rows=466,465 width=97) (actual time=0.945..849.030 rows=378,861 loops=1)

  • Hash Cond: (l.offer_id = f.id)
6. 235.142 729.852 ↑ 1.2 378,861 1

Hash Join (cost=111.15..983,230.63 rows=466,465 width=68) (actual time=0.521..729.852 rows=378,861 loops=1)

  • Hash Cond: (o.landing_id = l.id)
7. 494.202 494.202 ↑ 1.2 378,861 1

Index Scan using orders_created_at on orders o (cost=0.43..976,706.02 rows=466,465 width=76) (actual time=0.007..494.202 rows=378,861 loops=1)

  • Index Cond: ((created_at >= '2018-12-31 21:00:00+00'::timestamp with time zone) AND (created_at <= '2019-12-31 20:59:59+00'::timestamp with time zone))
  • Filter: (is_cold = 0)
  • Rows Removed by Filter: 3328
8. 0.227 0.508 ↓ 1.0 2,691 1

Hash (cost=77.54..77.54 rows=2,654 width=16) (actual time=0.508..0.508 rows=2,691 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 159kB
9. 0.281 0.281 ↓ 1.0 2,691 1

Seq Scan on landings l (cost=0.00..77.54 rows=2,654 width=16) (actual time=0.002..0.281 rows=2,691 loops=1)

10. 0.139 0.421 ↑ 1.0 1,449 1

Hash (cost=182.49..182.49 rows=1,449 width=45) (actual time=0.421..0.421 rows=1,449 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 131kB
11. 0.282 0.282 ↑ 1.0 1,449 1

Seq Scan on offers f (cost=0.00..182.49 rows=1,449 width=45) (actual time=0.003..0.282 rows=1,449 loops=1)

12. 0.003 0.007 ↑ 1.0 23 1

Hash (cost=2.23..2.23 rows=23 width=10) (actual time=0.007..0.007 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
13. 0.004 0.004 ↑ 1.0 23 1

Seq Scan on cancelation_reasons cr (cost=0.00..2.23 rows=23 width=10) (actual time=0.001..0.004 rows=23 loops=1)

14. 221,630.968 221,633.685 ↓ 16,869.0 16,869 378,861

Materialize (cost=0.43..8.45 rows=1 width=17) (actual time=0.000..0.585 rows=16,869 loops=378,861)

15. 2.717 2.717 ↓ 16,869.0 16,869 1

Index Scan using order_attribute_name on order_attributes oa (cost=0.43..8.45 rows=1 width=17) (actual time=0.009..2.717 rows=16,869 loops=1)

  • Index Cond: (name = 'redemption_probability'::text)