explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2Wnw : q18-p2y

Settings
# exclusive inclusive rows x rows loops node
1. 152.583 249.974 ↑ 1.0 57 1

Nested Loop (cost=8,199.60..8,461.80 rows=57 width=228) (actual time=38.085..249.974 rows=57 loops=1)

2.          

Initplan (for Nested Loop)

3. 0.851 10.145 ↑ 1.0 1 1

Aggregate (cost=3,415.95..3,416.21 rows=1 width=32) (actual time=10.144..10.145 rows=1 loops=1)

4. 3.654 9.294 ↑ 1.0 57 1

HashAggregate (cost=3,385.74..3,415.24 rows=57 width=61) (actual time=6.373..9.294 rows=57 loops=1)

  • Group Key: l_2.tuidout
5. 0.063 5.640 ↑ 1.0 399 1

Nested Loop (cost=0.69..3,382.75 rows=399 width=61) (actual time=0.085..5.640 rows=399 loops=1)

6. 0.235 1.587 ↑ 1.0 399 1

Nested Loop (cost=0.43..3,374.51 rows=399 width=54) (actual time=0.012..1.587 rows=399 loops=1)

7. 0.155 0.155 ↑ 1.0 399 1

Seq Scan on agg l_2 (cost=0.00..14.98 rows=399 width=8) (actual time=0.005..0.155 rows=399 loops=1)

  • Filter: ((location)::integer = 4)
  • Rows Removed by Filter: 399
8. 1.197 1.197 ↑ 1.0 1 399

Index Scan using lineitem_2_pkey on lineitem_2 l2 (cost=0.43..8.41 rows=1 width=54) (actual time=0.003..0.003 rows=1 loops=399)

  • Index Cond: (tuid = l_2.tuidin)
9. 3.990 3.990 ↑ 1.0 1 399

Function Scan on toy _y_3 (cost=0.25..0.26 rows=1 width=32) (actual time=0.009..0.010 rows=1 loops=399)

10. 39.456 59.373 ↑ 1.0 57 1

HashAggregate (cost=4,783.13..4,957.26 rows=57 width=218) (actual time=24.101..59.373 rows=57 loops=1)

  • Group Key: l_1.tuidout
11. 0.486 19.917 ↓ 2.0 399 1

Nested Loop (cost=14.79..4,773.63 rows=200 width=218) (actual time=0.626..19.917 rows=399 loops=1)

12. 0.317 12.648 ↓ 2.0 399 1

Nested Loop (cost=14.51..4,769.36 rows=200 width=186) (actual time=0.487..12.648 rows=399 loops=1)

13. 0.454 6.745 ↓ 2.0 399 1

Nested Loop (cost=14.26..4,765.10 rows=200 width=204) (actual time=0.344..6.745 rows=399 loops=1)

14. 0.438 4.695 ↓ 2.0 399 1

Nested Loop (cost=13.82..3,081.12 rows=200 width=158) (actual time=0.322..4.695 rows=399 loops=1)

15. 0.333 3.060 ↓ 2.0 399 1

Nested Loop (cost=13.40..1,428.21 rows=200 width=62) (actual time=0.305..3.060 rows=399 loops=1)

16. 0.262 0.732 ↓ 2.0 399 1

Hash Join (cost=12.98..31.45 rows=200 width=16) (actual time=0.287..0.732 rows=399 loops=1)

  • Hash Cond: (l_1.tuidin = j.tuidout)
17. 0.270 0.270 ↑ 1.0 399 1

Seq Scan on agg l_1 (cost=0.00..14.98 rows=399 width=8) (actual time=0.069..0.270 rows=399 loops=1)

  • Filter: ((location)::integer = 2)
  • Rows Removed by Filter: 399
18. 0.090 0.200 ↑ 1.0 399 1

Hash (cost=7.99..7.99 rows=399 width=16) (actual time=0.200..0.200 rows=399 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 27kB
19. 0.110 0.110 ↑ 1.0 399 1

Seq Scan on join3 j (cost=0.00..7.99 rows=399 width=16) (actual time=0.011..0.110 rows=399 loops=1)

  • Filter: ((location)::integer = (3)::integer)
20. 1.995 1.995 ↑ 1.0 1 399

Index Scan using customer_2_pkey on customer_2 c (cost=0.42..6.97 rows=1 width=54) (actual time=0.005..0.005 rows=1 loops=399)

  • Index Cond: (tuid = j.tuid1)
21. 1.197 1.197 ↑ 1.0 1 399

Index Scan using orders_2_pkey on orders_2 o (cost=0.43..8.25 rows=1 width=104) (actual time=0.003..0.003 rows=1 loops=399)

  • Index Cond: (tuid = j.tuid2)
22. 1.596 1.596 ↑ 1.0 1 399

Index Scan using lineitem_2_pkey on lineitem_2 l (cost=0.43..8.41 rows=1 width=54) (actual time=0.004..0.004 rows=1 loops=399)

  • Index Cond: (tuid = j.tuid3)
23. 5.586 5.586 ↑ 1.0 1 399

Function Scan on toy _y_2 (cost=0.26..0.27 rows=1 width=32) (actual time=0.014..0.014 rows=1 loops=399)

24. 6.783 6.783 ↑ 1.0 1 399

Function Scan on toy _y_1 (cost=0.27..0.28 rows=1 width=32) (actual time=0.017..0.017 rows=1 loops=399)

25. 27.873 27.873 ↑ 1.0 1 57

Function Scan on toy _y (cost=0.26..0.27 rows=1 width=32) (actual time=0.489..0.489 rows=1 loops=57)

Planning time : 7.993 ms
Execution time : 250.512 ms