explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZQmu

Settings
# exclusive inclusive rows x rows loops node
1. 658.159 658.159 ↑ 1.3 35 1

CTE Scan on useroverview (cost=63,036.84..63,037.78 rows=47 width=419) (actual time=28.649..658.159 rows=35 loops=1)

2.          

CTE useroverview

3. 0.431 657.949 ↑ 1.3 35 1

Hash Left Join (cost=319.49..63,036.84 rows=47 width=419) (actual time=28.643..657.949 rows=35 loops=1)

  • Hash Cond: (u.teamid = t.id)
4.          

CTE feedbackorder

5. 0.561 8.585 ↑ 5.0 4 1

HashAggregate (cost=314.63..314.83 rows=20 width=20) (actual time=8.583..8.585 rows=4 loops=1)

  • Group Key: o.userid
6. 0.791 8.024 ↓ 1.0 1,416 1

Merge Join (cost=276.91..304.22 rows=1,387 width=16) (actual time=7.057..8.024 rows=1,416 loops=1)

  • Merge Cond: (o.feedbackcode = fb.code)
7. 0.044 0.044 ↑ 1,628.5 10 1

Index Scan using "Order_feedbackcode_key" on "Order" o (cost=0.29..2,207.82 rows=16,285 width=9) (actual time=0.013..0.044 rows=10 loops=1)

8. 6.339 7.189 ↑ 1.0 2,955 1

Sort (cost=273.42..281.12 rows=3,082 width=17) (actual time=6.852..7.189 rows=2,955 loops=1)

  • Sort Key: fb.code
  • Sort Method: quicksort Memory: 337kB
9. 0.850 0.850 ↑ 1.0 3,082 1

Seq Scan on feedback fb (cost=0.00..94.82 rows=3,082 width=17) (actual time=0.006..0.850 rows=3,082 loops=1)

10. 0.061 8.947 ↑ 1.3 35 1

Hash Left Join (cost=3.46..8.58 rows=47 width=339) (actual time=8.677..8.947 rows=35 loops=1)

  • Hash Cond: (u.id = fbo.userid)
11. 0.057 0.290 ↑ 1.3 35 1

Hash Left Join (cost=2.81..7.55 rows=47 width=323) (actual time=0.074..0.290 rows=35 loops=1)

  • Hash Cond: (u.invoiceorg = invcomp.id)
12. 0.092 0.211 ↑ 1.3 35 1

Hash Left Join (cost=1.41..6.01 rows=47 width=291) (actual time=0.048..0.211 rows=35 loops=1)

  • Hash Cond: (u.org = comp.id)
13. 0.091 0.091 ↑ 1.3 35 1

Seq Scan on "User" u (cost=0.00..4.47 rows=47 width=259) (actual time=0.012..0.091 rows=35 loops=1)

14. 0.011 0.028 ↑ 1.0 18 1

Hash (cost=1.18..1.18 rows=18 width=36) (actual time=0.027..0.028 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.017 0.017 ↑ 1.0 18 1

Seq Scan on company comp (cost=0.00..1.18 rows=18 width=36) (actual time=0.005..0.017 rows=18 loops=1)

16. 0.008 0.022 ↑ 1.0 18 1

Hash (cost=1.18..1.18 rows=18 width=36) (actual time=0.021..0.022 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.014 0.014 ↑ 1.0 18 1

Seq Scan on company invcomp (cost=0.00..1.18 rows=18 width=36) (actual time=0.004..0.014 rows=18 loops=1)

18. 0.005 8.596 ↑ 5.0 4 1

Hash (cost=0.40..0.40 rows=20 width=20) (actual time=8.596..8.596 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
19. 8.591 8.591 ↑ 5.0 4 1

CTE Scan on feedbackorder fbo (cost=0.00..0.40 rows=20 width=20) (actual time=8.586..8.591 rows=4 loops=1)

20. 0.005 0.021 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=36) (actual time=0.021..0.021 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
21. 0.016 0.016 ↑ 1.0 9 1

Seq Scan on team t (cost=0.00..1.09 rows=9 width=36) (actual time=0.013..0.016 rows=9 loops=1)

22.          

SubPlan (for Hash Left Join)

23. 0.140 325.080 ↑ 1.0 1 35

Limit (cost=667.34..667.34 rows=1 width=8) (actual time=9.287..9.288 rows=1 loops=35)

24. 1.155 324.940 ↑ 155.0 1 35

Sort (cost=667.34..667.73 rows=155 width=8) (actual time=9.284..9.284 rows=1 loops=35)

  • Sort Key: "Order".created DESC
  • Sort Method: top-N heapsort Memory: 25kB
25. 323.785 323.785 ↑ 1.7 89 35

Seq Scan on "Order" (cost=0.00..666.56 rows=155 width=8) (actual time=5.460..9.251 rows=89 loops=35)

  • Filter: (userid = u.id)
  • Rows Removed by Filter: 16237
26. 0.805 323.470 ↑ 1.0 1 35

Aggregate (cost=666.95..666.96 rows=1 width=8) (actual time=9.241..9.242 rows=1 loops=35)

27. 322.665 322.665 ↑ 1.7 89 35

Seq Scan on "Order" "Order_1" (cost=0.00..666.56 rows=155 width=4) (actual time=5.419..9.219 rows=89 loops=35)

  • Filter: (userid = u.id)
  • Rows Removed by Filter: 16237
Planning time : 1.380 ms
Execution time : 658.367 ms