explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YCIk

Settings
# exclusive inclusive rows x rows loops node
1. 897.256 2,034.862 ↑ 75.4 7,568 1

GroupAggregate (cost=1,036,462.88..1,426,244.40 rows=570,699 width=92) (actual time=1,097.863..2,034.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)))
  • Planning time: 2.688 ms
  • Execution time: 2040.309 ms
2. 490.131 1,137.606 ↑ 1.2 378,861 1

Sort (cost=1,036,462.88..1,037,629.05 rows=466,465 width=92) (actual time=1,097.817..1,137.606 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. 181.856 647.475 ↑ 1.2 378,861 1

Hash Left Join (cost=825.79..992,541.92 rows=466,465 width=92) (actual time=10.370..647.475 rows=378,861 loops=1)

  • Hash Cond: (o.id = oa.order_id)
4. 51.633 458.571 ↑ 1.2 378,861 1

Hash Left Join (cost=817.33..988,451.88 rows=466,465 width=91) (actual time=3.309..458.571 rows=378,861 loops=1)

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

Hash Join (cost=800.58..983,920.05 rows=466,465 width=97) (actual time=3.284..406.921 rows=378,861 loops=1)

  • Hash Cond: (o.landing_id = l.id)
6. 263.538 263.538 ↑ 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.010..263.538 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
7. 0.450 3.261 ↓ 1.0 2,691 1

Hash (cost=766.97..766.97 rows=2,654 width=45) (actual time=3.261..3.261 rows=2,691 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 244kB
8. 0.643 2.811 ↓ 1.0 2,691 1

Merge Join (cost=0.56..766.97 rows=2,654 width=45) (actual time=0.008..2.811 rows=2,691 loops=1)

  • Merge Cond: (f.id = l.offer_id)
9. 1.341 1.341 ↑ 1.0 1,449 1

Index Scan using offers_pkey on offers f (cost=0.28..700.32 rows=1,449 width=45) (actual time=0.003..1.341 rows=1,449 loops=1)

10. 0.827 0.827 ↓ 1.0 2,691 1

Index Scan using landings_offer_id on landings l (cost=0.28..150.28 rows=2,654 width=16) (actual time=0.004..0.827 rows=2,691 loops=1)

11. 0.004 0.017 ↑ 1.0 23 1

Hash (cost=16.46..16.46 rows=23 width=10) (actual time=0.017..0.017 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
12. 0.013 0.013 ↑ 1.0 23 1

Index Scan using cancelation_reasons_pkey on cancelation_reasons cr (cost=0.14..16.46 rows=23 width=10) (actual time=0.005..0.013 rows=23 loops=1)

13. 2.763 7.048 ↓ 16,869.0 16,869 1

Hash (cost=8.45..8.45 rows=1 width=17) (actual time=7.048..7.048 rows=16,869 loops=1)

  • Buckets: 32768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1317kB
14. 4.285 4.285 ↓ 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.013..4.285 rows=16,869 loops=1)

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