explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ck7m

Settings
# exclusive inclusive rows x rows loops node
1. 4,588.510 20,068.177 ↓ 1.7 39,668 1

GroupAggregate (cost=2,409,810.43..2,454,450.51 rows=23,648 width=36) (actual time=13,958.139..20,068.177 rows=39,668 loops=1)

  • Group Key: oii.item_id
2. 7,384.771 15,479.667 ↓ 3.3 7,278,050 1

Sort (cost=2,409,810.43..2,415,360.88 rows=2,220,180 width=529) (actual time=13,957.836..15,479.667 rows=7,278,050 loops=1)

  • Sort Key: oii.item_id
  • Sort Method: external merge Disk: 209416kB
3. 1,366.309 8,094.896 ↓ 3.3 7,278,050 1

Hash Join (cost=202,512.53..582,183.03 rows=2,220,180 width=529) (actual time=2,245.038..8,094.896 rows=7,278,050 loops=1)

  • Hash Cond: (oi.keep_status = roks.id)
4. 3,211.906 6,728.577 ↓ 3.3 7,278,050 1

Hash Join (cost=202,511.46..551,654.49 rows=2,220,180 width=15) (actual time=2,245.010..6,728.577 rows=7,278,050 loops=1)

  • Hash Cond: (oii.order_id = oi.id)
5. 1,272.199 1,272.199 ↑ 1.0 7,381,909 1

Seq Scan on order_item oii (cost=0.00..224,948.99 rows=7,400,599 width=13) (actual time=0.006..1,272.199 rows=7,381,909 loops=1)

6. 214.069 2,244.472 ↓ 3.3 1,328,363 1

Hash (cost=195,505.66..195,505.66 rows=403,024 width=10) (actual time=2,244.472..2,244.472 rows=1,328,363 loops=1)

  • Buckets: 131072 (originally 131072) Batches: 32 (originally 8) Memory Usage: 3073kB
7. 836.925 2,030.403 ↓ 3.3 1,328,363 1

Hash Join (cost=128,554.59..195,505.66 rows=403,024 width=10) (actual time=894.652..2,030.403 rows=1,328,363 loops=1)

  • Hash Cond: (p.order_id = oi.id)
8. 299.442 299.442 ↓ 1.0 1,353,699 1

Index Only Scan using ix_payment_order_id on payment p (cost=0.43..45,771.37 rows=1,346,906 width=4) (actual time=0.029..299.442 rows=1,353,699 loops=1)

  • Heap Fetches: 415416
9. 219.270 894.036 ↓ 3.3 1,328,363 1

Hash (cost=121,941.36..121,941.36 rows=403,024 width=6) (actual time=894.035..894.036 rows=1,328,363 loops=1)

  • Buckets: 131072 (originally 131072) Batches: 32 (originally 8) Memory Usage: 3073kB
10. 513.759 674.766 ↓ 3.3 1,328,363 1

Hash Join (cost=1.18..121,941.36 rows=403,024 width=6) (actual time=0.025..674.766 rows=1,328,363 loops=1)

  • Hash Cond: (oi.order_type = rot.id)
11. 160.995 160.995 ↓ 1.0 1,353,699 1

Seq Scan on "order" oi (cost=0.00..112,872.14 rows=1,343,414 width=8) (actual time=0.002..160.995 rows=1,353,699 loops=1)

12. 0.005 0.012 ↑ 1.0 3 1

Hash (cost=1.14..1.14 rows=3 width=4) (actual time=0.011..0.012 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.007 0.007 ↑ 1.0 3 1

Seq Scan on order_type rot (cost=0.00..1.14 rows=3 width=4) (actual time=0.005..0.007 rows=3 loops=1)

  • Filter: ((value)::text = ANY ('{registration,"on demand",periodic}'::text[]))
  • Rows Removed by Filter: 7
14. 0.005 0.010 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=520) (actual time=0.010..0.010 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.005 0.005 ↑ 1.0 3 1

Seq Scan on order_keep_status roks (cost=0.00..1.03 rows=3 width=520) (actual time=0.004..0.005 rows=3 loops=1)

Planning time : 0.966 ms
Execution time : 20,105.169 ms