explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9r7B

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1,103.714 ↑ 10.8 50 1

Finalize GroupAggregate (cost=28,143.08..28,286.64 rows=540 width=162) (actual time=1,103.464..1,103.714 rows=50 loops=1)

  • Group Key: state.state_id
2. 0.000 1,135.340 ↑ 7.2 150 1

Gather Merge (cost=28,143.08..28,269.09 rows=1,080 width=162) (actual time=1,103.440..1,135.340 rows=150 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.267 2,920.506 ↑ 10.8 50 3

Sort (cost=27,143.06..27,144.41 rows=540 width=162) (actual time=973.498..973.502 rows=50 loops=3)

  • Sort Key: state.state_id
  • Sort Method: quicksort Memory: 32kB
  • Worker 0: Sort Method: quicksort Memory: 32kB
  • Worker 1: Sort Method: quicksort Memory: 32kB
4. 676.329 2,920.239 ↑ 10.8 50 3

Partial HashAggregate (cost=27,111.80..27,118.55 rows=540 width=162) (actual time=973.359..973.413 rows=50 loops=3)

  • Group Key: state.state_id
5. 309.561 2,243.910 ↑ 1.3 333,333 3

Hash Join (cost=3,615.44..21,903.46 rows=416,667 width=131) (actual time=88.402..747.970 rows=333,333 loops=3)

  • Hash Cond: (customer.state_id = state.state_id)
6. 1,051.809 1,933.188 ↑ 1.3 333,333 3

Hash Join (cost=3,593.29..20,778.97 rows=416,667 width=13) (actual time=87.955..644.396 rows=333,333 loops=3)

  • Hash Cond: (sale.customer_id = customer.customer_id)
7. 487.974 641.340 ↑ 1.3 333,333 3

Hash Join (cost=300.00..11,930.88 rows=416,667 width=13) (actual time=5.490..213.780 rows=333,333 loops=3)

  • Hash Cond: (sale.product_id = product.product_id)
8. 137.256 137.256 ↑ 1.3 333,333 3

Parallel Seq Scan on sale (cost=0.00..10,536.67 rows=416,667 width=17) (actual time=0.020..45.752 rows=333,333 loops=3)

9. 8.211 16.110 ↑ 1.0 10,000 3

Hash (cost=175.00..175.00 rows=10,000 width=4) (actual time=5.370..5.370 rows=10,000 loops=3)

  • Buckets: 16384 Batches: 1 Memory Usage: 480kB
10. 7.899 7.899 ↑ 1.0 10,000 3

Seq Scan on product (cost=0.00..175.00 rows=10,000 width=4) (actual time=0.263..2.633 rows=10,000 loops=3)

11. 152.394 240.039 ↑ 1.0 100,000 3

Hash (cost=1,652.13..1,652.13 rows=100,013 width=8) (actual time=80.013..80.013 rows=100,000 loops=3)

  • Buckets: 131072 Batches: 2 Memory Usage: 2976kB
12. 87.645 87.645 ↑ 1.0 100,000 3

Seq Scan on customer (cost=0.00..1,652.13 rows=100,013 width=8) (actual time=0.324..29.215 rows=100,000 loops=3)

13. 0.093 1.161 ↑ 10.8 50 3

Hash (cost=15.40..15.40 rows=540 width=122) (actual time=0.387..0.387 rows=50 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
14. 1.068 1.068 ↑ 10.8 50 3

Seq Scan on state (cost=0.00..15.40 rows=540 width=122) (actual time=0.345..0.356 rows=50 loops=3)