explain.depesz.com

PostgreSQL's explain analyze made readable

Result: b4X0

Settings
# exclusive inclusive rows x rows loops node
1. 88.575 13,210.966 ↓ 1.1 2,036 1

GroupAggregate (cost=158,737.26..158,814.70 rows=1,936 width=70) (actual time=13,097.779..13,210.966 rows=2,036 loops=1)

  • Group Key: (to_char(o.placed_at, 'yyyy-mm'::text)), c.name, cc.code_primary
2. 724.222 13,122.391 ↓ 50.6 98,046 1

Sort (cost=158,737.26..158,742.10 rows=1,936 width=70) (actual time=13,097.685..13,122.391 rows=98,046 loops=1)

  • Sort Key: (to_char(o.placed_at, 'yyyy-mm'::text)), c.name, cc.code_primary
  • Sort Method: quicksort Memory: 16865kB
3. 318.436 12,398.169 ↓ 50.6 98,046 1

Nested Loop (cost=542.16..158,631.57 rows=1,936 width=70) (actual time=0.477..12,398.169 rows=98,046 loops=1)

4. 1,405.076 3,956.233 ↓ 40.7 162,470 1

Hash Join (cost=541.72..154,734.19 rows=3,988 width=46) (actual time=0.449..3,956.233 rows=162,470 loops=1)

  • Hash Cond: (cc.coupon_id = c.id)
5. 2,550.726 2,550.726 ↓ 1.0 5,262,215 1

Seq Scan on cart_coupon cc (cost=0.00..134,699.61 rows=5,187,461 width=33) (actual time=0.007..2,550.726 rows=5,262,215 loops=1)

6. 0.119 0.431 ↓ 1.0 269 1

Hash (cost=538.39..538.39 rows=267 width=29) (actual time=0.431..0.431 rows=269 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
7. 0.312 0.312 ↓ 1.0 269 1

Index Scan using coupon_store_idx on coupon c (cost=0.42..538.39 rows=267 width=29) (actual time=0.014..0.312 rows=269 loops=1)

  • Index Cond: (store_id = 7843116)
8. 8,123.500 8,123.500 ↑ 1.0 1 162,470

Index Scan using order_pkey on "order" o (cost=0.44..0.97 rows=1 width=32) (actual time=0.050..0.050 rows=1 loops=162,470)

  • Index Cond: (id = cc.order_id)
  • Filter: (financial_status = ANY ('{4,5,6}'::integer[]))
  • Rows Removed by Filter: 0
Planning time : 0.658 ms
Execution time : 13,212.961 ms