explain.depesz.com

A tool for finding a real cause for slow queries.

Result: AEK

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

Sort (cost=8,141,882.12..8,142,089.69 rows=83,028 width=181) (actual time=.. rows= loops=)

  • Sort Key: stock.part, stock.company, stock.depot
2. 0.000 0.000 ↓ 0.0

Hash Join (cost=120,017.72..8,135,098.19 rows=83,028 width=181) (actual time=.. rows= loops=)

  • Hash Cond: (stprice.stockid = stock.stockid)
3. 0.000 0.000 ↓ 0.0

Seq Scan on stprice (cost=0.00..203,621.42 rows=5,608,242 width=13) (actual time=.. rows= loops=)

4. 0.000 0.000 ↓ 0.0

Hash (cost=118,979.87..118,979.87 rows=83,028 width=172) (actual time=.. rows= loops=)

5. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=112,411.09..118,979.87 rows=83,028 width=172) (actual time=.. rows= loops=)

  • Merge Cond: (((stock.product_group)::text = (grpdesc.id)::text) AND (stock.company = grpdesc.company))
6. 0.000 0.000 ↓ 0.0

Sort (cost=10,525.60..10,733.13 rows=83,014 width=150) (actual time=.. rows= loops=)

  • Sort Key: stock.product_group, stock.company
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=23.34..3,742.91 rows=83,014 width=150) (actual time=.. rows= loops=)

  • Join Filter: ((stock.part)::text = fn_stksrch_grep_perl.fn_stksrch_grep_perl)
8. 0.000 0.000 ↓ 0.0

HashAggregate (cost=12.75..14.75 rows=200 width=32) (actual time=.. rows= loops=)

9. 0.000 0.000 ↓ 0.0

Function Scan on fn_stksrch_grep_perl (cost=0.25..10.25 rows=1,000 width=32) (actual time=.. rows= loops=)

10. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on stock (cost=10.59..18.62 rows=2 width=150) (actual time=.. rows= loops=)

  • Recheck Cond: (((company = 1) AND ((depot)::text = 01::text) AND ((part)::text = fn_stksrch_grep_perl.fn_stksrch_grep_perl)) OR ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = fn_stksrch_grep_perl.fn_stksrch_grep_perl)))
11. 0.000 0.000 ↓ 0.0

BitmapOr (cost=10.59..10.59 rows=2 width=0) (actual time=.. rows= loops=)

12. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((company = 1) AND ((depot)::text = 01::text) AND ((part)::text = fn_stksrch_grep_perl.fn_stksrch_grep_perl))
13. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on stock_idx1 (cost=0.00..5.29 rows=2 width=0) (actual time=.. rows= loops=)

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = fn_stksrch_grep_perl.fn_stksrch_grep_perl))
14. 0.000 0.000 ↓ 0.0

Sort (cost=101,778.57..103,535.01 rows=702,575 width=30) (actual time=.. rows= loops=)

  • Sort Key: grpdesc.id, grpdesc.company
15. 0.000 0.000 ↓ 0.0

Seq Scan on grpdesc (cost=0.00..33,550.49 rows=702,575 width=30) (actual time=.. rows= loops=)

  • Filter: ((record_type)::text = G::text)
16.          

SubPlan (forHash Join)

17. 0.000 0.000 ↓ 0.0

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

18. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
19. 0.000 0.000 ↓ 0.0

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

20. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
21. 0.000 0.000 ↓ 0.0

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

22. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
23. 0.000 0.000 ↓ 0.0

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

24. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
25. 0.000 0.000 ↓ 0.0

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

26. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
27. 0.000 0.000 ↓ 0.0

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

28. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((company = 81) AND ((depot)::text = 81::text) AND ((part)::text = (stock.part)::text))
29. 0.000 0.000 ↓ 0.0

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

30. 0.000 0.000 ↓ 0.0

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

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