explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kVEB

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

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

2.          

CTE useroverview

3. 0.449 656.628 ↑ 1.3 35 1

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

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

CTE feedbackorder

5. 0.743 9.431 ↑ 5.0 4 1

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

  • Group Key: o.userid
6. 1.073 8.688 ↓ 1.0 1,416 1

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

  • Merge Cond: (o.feedbackcode = fb.code)
7. 0.062 0.062 ↑ 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.062 rows=10 loops=1)

8. 6.631 7.553 ↑ 1.0 2,955 1

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

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

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

10. 0.067 9.812 ↑ 1.3 35 1

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

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

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

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

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

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

Seq Scan on "User" u (cost=0.00..4.47 rows=47 width=259) (actual time=0.012..0.088 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.006..0.017 rows=18 loops=1)

16. 0.008 0.023 ↑ 1.0 18 1

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

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

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

18. 0.006 9.446 ↑ 5.0 4 1

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

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

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

20. 0.007 0.022 ↑ 1.0 9 1

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

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

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

22.          

SubPlan (for Hash Left Join)

23. 0.105 324.310 ↑ 1.0 1 35

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

24. 1.155 324.205 ↑ 155.0 1 35

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

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

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

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

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

27. 321.335 321.335 ↑ 1.7 89 35

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

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