explain.depesz.com

PostgreSQL's explain analyze made readable

Result: I2zT

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 13,552.651 ↑ 1.0 1 1

Aggregate (cost=1,136,640.90..1,136,640.91 rows=1 width=8) (actual time=13,552.651..13,552.651 rows=1 loops=1)

2. 0.003 13,552.647 ↑ 1.0 10 1

Limit (cost=1,136,640.60..1,136,640.77 rows=10 width=121) (actual time=13,552.637..13,552.647 rows=10 loops=1)

3. 0.014 13,552.644 ↑ 518,613.1 10 1

GroupAggregate (cost=1,136,640.60..1,227,397.89 rows=5,186,131 width=121) (actual time=13,552.635..13,552.644 rows=10 loops=1)

  • Group Key: p0.id, d1.name
4. 4,256.317 13,552.630 ↑ 345,742.1 15 1

Sort (cost=1,136,640.60..1,149,605.92 rows=5,186,131 width=33) (actual time=13,552.628..13,552.630 rows=15 loops=1)

  • Sort Key: p0.id DESC, d1.name
  • Sort Method: external merge Disk: 216,104kB
5. 2,023.385 9,296.313 ↓ 1.0 5,186,191 1

Hash Join (cost=71,917.47..274,606.52 rows=5,186,131 width=33) (actual time=1,158.068..9,296.313 rows=5,186,191 loops=1)

  • Hash Cond: (p0.distributor_id = d1.id)
6. 4,589.511 7,272.437 ↓ 1.0 5,186,191 1

Hash Right Join (cost=71,879.71..260,892.64 rows=5,186,131 width=20) (actual time=1,157.565..7,272.437 rows=5,186,191 loops=1)

  • Hash Cond: (p2.purchase_order_id = p0.id)
7. 1,526.062 1,526.062 ↑ 1.0 5,186,004 1

Seq Scan on purchase_order_items p2 (cost=0.00..124,773.31 rows=5,186,131 width=8) (actual time=0.019..1,526.062 rows=5,186,004 loops=1)

8. 568.233 1,156.864 ↓ 1.0 1,725,117 1

Hash (cost=40,207.98..40,207.98 rows=1,725,098 width=20) (actual time=1,156.863..1,156.864 rows=1,725,117 loops=1)

  • Buckets: 65,536 Batches: 32 Memory Usage: 3,270kB
9. 588.631 588.631 ↓ 1.0 1,725,117 1

Seq Scan on purchase_orders p0 (cost=0.00..40,207.98 rows=1,725,098 width=20) (actual time=0.048..588.631 rows=1,725,117 loops=1)

10. 0.267 0.491 ↑ 1.0 923 1

Hash (cost=26.23..26.23 rows=923 width=21) (actual time=0.491..0.491 rows=923 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 58kB
11. 0.224 0.224 ↑ 1.0 923 1

Seq Scan on distributors d1 (cost=0.00..26.23 rows=923 width=21) (actual time=0.013..0.224 rows=923 loops=1)

Planning time : 0.733 ms
Execution time : 13,611.452 ms