explain.depesz.com

A tool for finding a real cause for slow queries.

Result: 60N

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.229 233.610 ↓ 32.0 32 1

Sort (cost=138.65..138.65 rows=1 width=181) (actual time=233.601..233.610 rows=32 loops=1)

  • Sort Key: stock.part, stock.company, stock.depot
  • Sort Method: quicksort Memory: 39kB
2. 1.303 233.381 ↓ 32.0 32 1

Nested Loop Left Join (cost=10.72..138.64 rows=1 width=181) (actual time=222.322..233.381 rows=32 loops=1)

  • Join Filter: (stprice.company = stock.company)
3. 0.169 223.950 ↓ 32.0 32 1

Nested Loop (cost=10.72..37.82 rows=1 width=161) (actual time=221.509..223.950 rows=32 loops=1)

4. 0.400 222.821 ↓ 16.0 32 1

Nested Loop (cost=10.72..19.05 rows=2 width=182) (actual time=221.399..222.821 rows=32 loops=1)

  • Join Filter: ((stock.part)::text = (fn_stksrch_grep_perl(246, HAMMER KEN 16::text, 200, 0)))
5. 221.044 221.044 ↓ 17.0 17 1

Result (cost=0.00..0.26 rows=1 width=0) (actual time=221.026..221.044 rows=17 loops=1)

6. 0.238 1.377 ↑ 1.0 2 17

Bitmap Heap Scan on stock (cost=10.72..18.75 rows=2 width=150) (actual time=0.078..0.081 rows=2 loops=17)

  • Recheck Cond: (((company = 1) AND ((depot)::text = 01::text) AND ((part)::text = (fn_stksrch_grep_perl(246, HAMMER KEN 16::text, 200, 0)))) OR ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (fn_stksrch_grep_perl(246, HAMMER KEN 16::text, 200, 0)))))
7. 0.068 1.139 ↓ 0.0 0 17

BitmapOr (cost=10.72..10.72 rows=2 width=0) (actual time=0.067..0.067 rows=0 loops=17)

8. 0.527 0.527 ↑ 1.0 1 17

Bitmap Index Scan on stock_idx1 (cost=0.00..5.36 rows=1 width=0) (actual time=0.031..0.031 rows=1 loops=17)

  • Index Cond: ((company = 1) AND ((depot)::text = 01::text) AND ((part)::text = (fn_stksrch_grep_perl(246, HAMMER KEN 16::text, 200, 0))))
9. 0.544 0.544 ↑ 2.0 1 17

Bitmap Index Scan on stock_idx1 (cost=0.00..5.36 rows=2 width=0) (actual time=0.032..0.032 rows=1 loops=17)

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (fn_stksrch_grep_perl(246, HAMMER KEN 16::text, 200, 0))))
10. 0.960 0.960 ↑ 1.0 1 32

Index Scan using stprice_idx1 on stprice (cost=0.00..9.37 rows=1 width=25) (actual time=0.029..0.030 rows=1 loops=32)

  • Index Cond: ((company = stock.company) AND ((depot)::text = (stock.depot)::text) AND ((part)::text = (stock.part)::text))
11. 0.736 0.736 ↑ 1.0 1 32

Index Scan using grpdesc_idx1 on grpdesc (cost=0.00..7.14 rows=1 width=30) (actual time=0.021..0.023 rows=1 loops=32)

  • Index Cond: ((stock.company = company) AND ((record_type)::text = G::text) AND ((id)::text = (stock.product_group)::text))
12.          

SubPlan (forNested Loop Left Join)

13. 0.160 1.120 ↑ 1.0 1 32

Aggregate (cost=13.37..13.38 rows=1 width=8) (actual time=0.035..0.035 rows=1 loops=32)

14. 0.960 0.960 ↑ 2.0 1 32

Index Scan using stock_idx1 on stock a (cost=0.00..13.36 rows=2 width=8) (actual time=0.028..0.030 rows=1 loops=32)

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
15. 0.128 1.024 ↑ 1.0 1 32

Aggregate (cost=13.37..13.38 rows=1 width=8) (actual time=0.032..0.032 rows=1 loops=32)

16. 0.896 0.896 ↑ 2.0 1 32

Index Scan using stock_idx1 on stock a (cost=0.00..13.36 rows=2 width=8) (actual time=0.027..0.028 rows=1 loops=32)

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
17. 0.128 1.024 ↑ 1.0 1 32

Aggregate (cost=13.37..13.38 rows=1 width=8) (actual time=0.032..0.032 rows=1 loops=32)

18. 0.896 0.896 ↑ 2.0 1 32

Index Scan using stock_idx1 on stock a (cost=0.00..13.36 rows=2 width=8) (actual time=0.026..0.028 rows=1 loops=32)

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
19. 0.128 1.024 ↑ 1.0 1 32

Aggregate (cost=13.37..13.38 rows=1 width=8) (actual time=0.032..0.032 rows=1 loops=32)

20. 0.896 0.896 ↑ 2.0 1 32

Index Scan using stock_idx1 on stock a (cost=0.00..13.36 rows=2 width=8) (actual time=0.026..0.028 rows=1 loops=32)

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
21. 0.192 1.088 ↑ 1.0 1 32

Aggregate (cost=13.37..13.38 rows=1 width=8) (actual time=0.034..0.034 rows=1 loops=32)

22. 0.896 0.896 ↑ 2.0 1 32

Index Scan using stock_idx1 on stock a (cost=0.00..13.36 rows=2 width=8) (actual time=0.027..0.028 rows=1 loops=32)

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
23. 0.192 1.088 ↑ 1.0 1 32

Aggregate (cost=13.37..13.38 rows=1 width=8) (actual time=0.034..0.034 rows=1 loops=32)

24. 0.896 0.896 ↑ 2.0 1 32

Index Scan using stock_idx1 on stock a (cost=0.00..13.36 rows=2 width=8) (actual time=0.026..0.028 rows=1 loops=32)

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
25. 0.128 1.024 ↑ 1.0 1 32

Aggregate (cost=13.37..13.38 rows=1 width=8) (actual time=0.032..0.032 rows=1 loops=32)

26. 0.896 0.896 ↑ 2.0 1 32

Index Scan using stock_idx1 on stock a (cost=0.00..13.36 rows=2 width=8) (actual time=0.026..0.028 rows=1 loops=32)

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))