explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oHT

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 883.834 ↑ 1.0 50 1

Finalize GroupAggregate (cost=24,209.56..24,222.86 rows=50 width=162) (actual time=883.696..883.834 rows=50 loops=1)

  • Group Key: state.state_id
2. 0.000 900.645 ↓ 1.5 150 1

Gather Merge (cost=24,209.56..24,221.23 rows=100 width=162) (actual time=883.682..900.645 rows=150 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.198 2,474.424 ↑ 1.0 50 3

Sort (cost=23,209.54..23,209.67 rows=50 width=162) (actual time=824.804..824.808 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. 729.636 2,474.226 ↑ 1.0 50 3

Partial HashAggregate (cost=23,207.50..23,208.13 rows=50 width=162) (actual time=824.701..824.742 rows=50 loops=3)

  • Group Key: state.state_id
5. 334.134 1,744.590 ↑ 1.3 333,333 3

Hash Join (cost=4,083.86..17,999.17 rows=416,667 width=131) (actual time=40.032..581.530 rows=333,333 loops=3)

  • Hash Cond: (sale.product_id = product.product_id)
6. 332.082 1,408.515 ↑ 1.3 333,333 3

Hash Join (cost=4,053.36..16,870.28 rows=416,667 width=135) (actual time=39.365..469.505 rows=333,333 loops=3)

  • Hash Cond: (customer.state_id = state.state_id)
7. 630.324 1,075.593 ↑ 1.3 333,333 3

Parallel Hash Join (cost=4,051.23..15,681.70 rows=416,667 width=17) (actual time=39.069..358.531 rows=333,333 loops=3)

  • Hash Cond: (sale.customer_id = customer.customer_id)
8. 331.614 331.614 ↑ 1.3 333,333 3

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

9. 46.395 113.655 ↑ 1.3 33,333 3

Parallel Hash (cost=3,530.40..3,530.40 rows=41,667 width=8) (actual time=37.885..37.885 rows=33,333 loops=3)

  • Buckets: 131072 Batches: 1 Memory Usage: 4960kB
10. 67.260 67.260 ↓ 1.2 50,000 2

Parallel Index Only Scan using customer_index on customer (cost=0.29..3,530.40 rows=41,667 width=8) (actual time=0.543..33.630 rows=50,000 loops=2)

  • Heap Fetches: 100000
11. 0.072 0.840 ↑ 1.0 50 3

Hash (cost=1.50..1.50 rows=50 width=122) (actual time=0.280..0.280 rows=50 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
12. 0.768 0.768 ↑ 1.0 50 3

Seq Scan on state (cost=0.00..1.50 rows=50 width=122) (actual time=0.250..0.256 rows=50 loops=3)

13. 0.603 1.941 ↑ 1.0 1,000 3

Hash (cost=18.00..18.00 rows=1,000 width=4) (actual time=0.647..0.647 rows=1,000 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 44kB
14. 1.338 1.338 ↑ 1.0 1,000 3

Seq Scan on product (cost=0.00..18.00 rows=1,000 width=4) (actual time=0.283..0.446 rows=1,000 loops=3)

Planning time : 4.356 ms
Execution time : 901.050 ms