explain.depesz.com

A tool for finding a real cause for slow queries.

Result: 29O

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

Hash Join (cost=22815.47..328047.26 rows=12 width=114) (actual time=.. rows= loops=)

  • Hash Cond: ((dokmagkcf.idkontrahenta = kontrahencikcf.id) AND (dokmagkcf.nrbazy = kontrahencikcf.nrbazy) AND (historiamagkcf.idtowaru = towarykcf.id))
  • Join Filter: (SubPlan 2)
2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..112505.20 rows=4927 width=79) (actual time=.. rows= loops=)

3. 0.000 0.000 ↓ 0.0

Seq Scan on dokmagkcf (cost=0.00..84314.88 rows=1020 width=43) (actual time=.. rows= loops=)

  • Filter: ((data = '2012-04-20 00:00:00'::timestamp without time zone) AND ((rodzaj)::text = 'WZ'::text) AND (((rodzaj)::text = 'WZ'::text) OR ((rodzaj)::text = 'MM-'::text)))
4. 0.000 0.000 ↓ 0.0

Index Scan using historiamagkcf_iddokmag_nrbazy on historiamagkcf (cost=0.00..27.58 rows=4 width=44) (actual time=.. rows= loops=)

  • Index Cond: ((historiamagkcf.iddokmag = dokmagkcf.id) AND (historiamagkcf.nrbazy = dokmagkcf.nrbazy))
5. 0.000 0.000 ↓ 0.0

Hash (cost=17899.21..17899.21 rows=280929 width=63) (actual time=.. rows= loops=)

6. 0.000 0.000 ↓ 0.0

Merge Join (cost=13688.20..17899.21 rows=280929 width=63) (actual time=.. rows= loops=)

  • Merge Cond: (kontrahencikcf.nrbazy = towarykcf.nrbazy)
7. 0.000 0.000 ↓ 0.0

Sort (cost=360.33..360.93 rows=240 width=12) (actual time=.. rows= loops=)

  • Sort Key: kontrahencikcf.nrbazy
8. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.94..350.84 rows=240 width=12) (actual time=.. rows= loops=)

  • Hash Cond: ((kontrahencikcf.kodkomunikacji)::text = (res_dane_sklepow.komunikacja_symbol)::text)
9. 0.000 0.000 ↓ 0.0

Seq Scan on kontrahencikcf (cost=0.00..330.27 rows=4327 width=15) (actual time=.. rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash (cost=1.42..1.42 rows=42 width=11) (actual time=.. rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on res_dane_sklepow (cost=0.00..1.42 rows=42 width=11) (actual time=.. rows= loops=)

12. 0.000 0.000 ↓ 0.0

Sort (cost=13327.87..13376.31 rows=19374 width=51) (actual time=.. rows= loops=)

  • Sort Key: towarykcf.nrbazy
13. 0.000 0.000 ↓ 0.0

Hash Join (cost=2979.88..11948.27 rows=19374 width=51) (actual time=.. rows= loops=)

  • Hash Cond: ((towarykcf.kodpaskowy)::text = (towary.kodpaskowy)::text)
14. 0.000 0.000 ↓ 0.0

Seq Scan on towarykcf (cost=0.00..7978.22 rows=57922 width=21) (actual time=.. rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=2753.28..2753.28 rows=18128 width=43) (actual time=.. rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on towary (cost=0.00..2753.28 rows=18128 width=43) (actual time=.. rows= loops=)

17.          

SubPlan (forHash Join)

18. 0.000 0.000 ↓ 0.0

Merge Join (cost=1266.35..53196.56 rows=1 width=17) (actual time=.. rows= loops=)

  • Merge Cond: ((kontrahencikcf.kodkomunikacji)::text = (res_dane_sklepow.komunikacja_symbol)::text)
  • Join Filter: (NOT (SubPlan 1))
19. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..393356.92 rows=311 width=24) (actual time=.. rows= loops=)

20. 0.000 0.000 ↓ 0.0

Index Scan using kontrahencikcf_kodkomunikacji on kontrahencikcf (cost=0.00..6861.84 rows=4327 width=15) (actual time=.. rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Scan using dokmagkcf_nrbazy_idkontrahenta_data_wyslane on dokmagkcf (cost=0.00..89.31 rows=1 width=25) (actual time=.. rows= loops=)

  • Index Cond: ((dokmagkcf.nrbazy = kontrahencikcf.nrbazy) AND (dokmagkcf.idkontrahenta = kontrahencikcf.id))
  • Filter: ((dokmagkcf.data = $2) AND (((dokmagkcf.rodzaj)::text = 'WZ'::text) OR ((dokmagkcf.rodzaj)::text = 'MM-'::text)))
22. 0.000 0.000 ↓ 0.0

Sort (cost=1.53..1.54 rows=1 width=11) (actual time=.. rows= loops=)

  • Sort Key: res_dane_sklepow.komunikacja_symbol
23. 0.000 0.000 ↓ 0.0

Seq Scan on res_dane_sklepow (cost=0.00..1.52 rows=1 width=11) (actual time=.. rows= loops=)

  • Filter: (id = $3)
24.          

SubPlan (forMerge Join)

25. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on s_dokmag s (cost=1675.13..51506.96 rows=34268 width=16) (actual time=.. rows= loops=)

  • Recheck Cond: (id_sklep = $0)
  • Filter: (nrdokobcy IS NOT NULL)
26. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on s_dokmag_sklep_data_rodzaj (cost=0.00..1666.56 rows=55707 width=0) (actual time=.. rows= loops=)

  • Index Cond: (id_sklep = $0)