explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zSLV

Settings
# exclusive inclusive rows x rows loops node
1. 1,369.219 1,911.757 ↑ 1.2 18,708 1

Hash Right Join (cost=58,390.16..83,127.59 rows=22,440 width=2,163) (actual time=488.084..1,911.757 rows=18,708 loops=1)

  • Hash Cond: (r.id_kontrahenta = a.id_kontrahenta)
2. 30.129 70.228 ↓ 2.1 14,935 1

Hash Left Join (cost=1,116.03..2,316.14 rows=7,082 width=36) (actual time=15.276..70.228 rows=14,935 loops=1)

  • Hash Cond: (r.id_handlowca = s.kod)
3. 19.223 40.027 ↓ 2.1 14,935 1

Hash Join (cost=1,109.07..2,211.87 rows=7,082 width=8) (actual time=15.179..40.027 rows=14,935 loops=1)

  • Hash Cond: ((r.id_kontrahenta = spd_kontrahenci_hand.id_kontrahenta) AND (r.od_kiedy = (max(spd_kontrahenci_hand.od_kiedy))))
4. 5.658 5.658 ↓ 1.0 28,386 1

Seq Scan on spd_kontrahenci_hand r (cost=0.00..465.28 rows=28,328 width=12) (actual time=0.009..5.658 rows=28,386 loops=1)

5. 2.709 15.146 ↓ 1.0 14,935 1

Hash (cost=893.86..893.86 rows=14,347 width=8) (actual time=15.146..15.146 rows=14,935 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 584kB
6. 10.212 12.437 ↓ 1.0 14,935 1

HashAggregate (cost=606.92..750.39 rows=14,347 width=8) (actual time=10.339..12.437 rows=14,935 loops=1)

7. 2.225 2.225 ↓ 1.0 28,386 1

Seq Scan on spd_kontrahenci_hand (cost=0.00..465.28 rows=28,328 width=8) (actual time=0.004..2.225 rows=28,386 loops=1)

8. 0.021 0.072 ↓ 1.0 48 1

Hash (cost=6.38..6.38 rows=46 width=263) (actual time=0.072..0.072 rows=48 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
9. 0.029 0.051 ↓ 1.0 48 1

Hash Left Join (cost=1.29..6.38 rows=46 width=263) (actual time=0.024..0.051 rows=48 loops=1)

  • Hash Cond: (s.id_sieci = t.id)
10. 0.014 0.014 ↓ 1.0 48 1

Seq Scan on spd_handlowcy s (cost=0.00..4.46 rows=46 width=212) (actual time=0.004..0.014 rows=48 loops=1)

11. 0.005 0.008 ↑ 1.0 13 1

Hash (cost=1.13..1.13 rows=13 width=55) (actual time=0.008..0.008 rows=13 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
12. 0.003 0.003 ↑ 1.0 13 1

Seq Scan on spd_handlowcy_sieci t (cost=0.00..1.13 rows=13 width=55) (actual time=0.003..0.003 rows=13 loops=1)

13. 33.818 472.310 ↑ 1.2 18,708 1

Hash (cost=56,993.63..56,993.63 rows=22,440 width=2,131) (actual time=472.310..472.310 rows=18,708 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 33675kB
14. 21.471 438.492 ↑ 1.2 18,708 1

Merge Right Join (cost=56,429.05..56,993.63 rows=22,440 width=2,131) (actual time=415.680..438.492 rows=18,708 loops=1)

  • Merge Cond: ((btrim((i.kraj)::text)) = (btrim((j.pole_s1)::text)))
15. 0.358 0.558 ↑ 1.0 238 1

Sort (cost=100.83..101.43 rows=239 width=142) (actual time=0.542..0.558 rows=238 loops=1)

  • Sort Key: (btrim((i.kraj)::text))
  • Sort Method: quicksort Memory: 88kB
16. 0.200 0.200 ↑ 1.0 239 1

Seq Scan on spd_kraje i (cost=0.00..91.39 rows=239 width=142) (actual time=0.007..0.200 rows=239 loops=1)

17. 54.525 416.463 ↑ 1.0 18,708 1

Sort (cost=56,328.22..56,375.16 rows=18,778 width=2,264) (actual time=415.123..416.463 rows=18,708 loops=1)

  • Sort Key: (btrim((j.pole_s1)::text))
  • Sort Method: quicksort Memory: 44391kB
18. 62.850 361.938 ↑ 1.0 18,708 1

Hash Left Join (cost=45,476.49..54,995.28 rows=18,778 width=2,264) (actual time=260.786..361.938 rows=18,708 loops=1)

  • Hash Cond: (a.id_kontrahenta = spd_kontrahenci_hand_1.id_kontrahenta)
19. 30.873 273.082 ↑ 1.0 18,708 1

Hash Right Join (cost=42,360.08..51,524.15 rows=18,778 width=2,056) (actual time=234.747..273.082 rows=18,708 loops=1)

  • Hash Cond: (j.id_kontrahenta = a.id_kontrahenta)
20. 7.950 9.725 ↓ 1.1 18,709 1

Bitmap Heap Scan on spd_kontrahenci_info_dodatkow j (cost=388.69..9,141.27 rows=17,326 width=258) (actual time=2.242..9.725 rows=18,709 loops=1)

  • Recheck Cond: (rodzaj_info = 28)
21. 1.775 1.775 ↓ 1.1 18,709 1

Bitmap Index Scan on spd_kin_auto (cost=0.00..384.36 rows=17,326 width=0) (actual time=1.775..1.775 rows=18,709 loops=1)

  • Index Cond: (rodzaj_info = 28)
22. 33.470 232.484 ↑ 1.0 18,708 1

Hash (cost=41,736.66..41,736.66 rows=18,778 width=1,802) (actual time=232.484..232.484 rows=18,708 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 28415kB
23. 27.980 199.014 ↑ 1.0 18,708 1

Hash Right Join (cost=32,751.90..41,736.66 rows=18,778 width=1,802) (actual time=157.274..199.014 rows=18,708 loops=1)

  • Hash Cond: (k.id_kontrahenta = a.id_kontrahenta)
24. 13.806 13.806 ↓ 1.0 14,199 1

Index Only Scan using spd_kin_f_wart1 on spd_kontrahenci_info_dodatkow k (cost=0.42..8,651.97 rows=14,030 width=8) (actual time=0.026..13.806 rows=14,199 loops=1)

  • Index Cond: (rodzaj_info = 1)
  • Heap Fetches: 12557
25. 32.921 157.228 ↑ 1.0 18,708 1

Hash (cost=32,516.76..32,516.76 rows=18,778 width=1,798) (actual time=157.228..157.228 rows=18,708 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 28357kB
26. 22.864 124.307 ↑ 1.0 18,708 1

Hash Right Join (cost=32,242.20..32,516.76 rows=18,778 width=1,798) (actual time=100.965..124.307 rows=18,708 loops=1)

  • Hash Cond: (l.id_kontrahenta = a.id_kontrahenta)
27. 0.544 0.641 ↓ 4.4 640 1

Bitmap Heap Scan on spd_kontrahenci_info_dodatkow l (cost=5.54..276.65 rows=145 width=258) (actual time=0.146..0.641 rows=640 loops=1)

  • Recheck Cond: (rodzaj_info = 75)
28. 0.097 0.097 ↓ 4.4 644 1

Bitmap Index Scan on spd_kin_auto (cost=0.00..5.51 rows=145 width=0) (actual time=0.097..0.097 rows=644 loops=1)

  • Index Cond: (rodzaj_info = 75)
29. 34.952 100.802 ↑ 1.0 18,708 1

Hash (cost=32,001.94..32,001.94 rows=18,778 width=1,544) (actual time=100.802..100.802 rows=18,708 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 28176kB
30. 7.273 65.850 ↑ 1.0 18,708 1

Hash Left Join (cost=37.22..32,001.94 rows=18,778 width=1,544) (actual time=0.267..65.850 rows=18,708 loops=1)

  • Hash Cond: (a.kto = g.id_uzytkownika)
31. 6.329 58.420 ↑ 1.0 18,708 1

Hash Left Join (cost=8.09..31,714.61 rows=18,778 width=1,483) (actual time=0.100..58.420 rows=18,708 loops=1)

  • Hash Cond: (a.id_grupy_cennik = f.id)
32. 5.431 52.080 ↑ 1.0 18,708 1

Hash Left Join (cost=6.59..31,455.84 rows=18,778 width=1,382) (actual time=0.078..52.080 rows=18,708 loops=1)

  • Hash Cond: (a.grupa_rabatowa = e.id_grupy)
33. 5.957 46.622 ↑ 1.0 18,708 1

Hash Left Join (cost=2.95..31,212.26 rows=18,778 width=1,331) (actual time=0.041..46.622 rows=18,708 loops=1)

  • Hash Cond: (a.id_rodzaju3 = d.id_rodzaju)
34. 6.147 40.657 ↑ 1.0 18,708 1

Hash Left Join (cost=1.66..30,987.98 rows=18,778 width=1,290) (actual time=0.023..40.657 rows=18,708 loops=1)

  • Hash Cond: (a.id_rodzaju1 = b.id_rodzaju)
35. 19.444 34.506 ↑ 1.0 18,708 1

Merge Right Join (cost=0.54..30,760.23 rows=18,778 width=1,249) (actual time=0.010..34.506 rows=18,708 loops=1)

  • Merge Cond: (c.id_rodzaju = a.id_rodzaju2)
36. 0.012 0.012 ↓ 1.8 9 1

Index Scan using spd_rk2_auto on spd_kontrahenci_rodzaje2 c (cost=0.13..6.21 rows=5 width=45) (actual time=0.003..0.012 rows=9 loops=1)

37. 15.050 15.050 ↑ 1.0 18,708 1

Index Scan using spd_kon_f_rodzaj2 on spd_kontrahenci a (cost=0.41..30,621.71 rows=18,778 width=1,208) (actual time=0.005..15.050 rows=18,708 loops=1)

38. 0.001 0.004 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=45) (actual time=0.004..0.004 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
39. 0.003 0.003 ↑ 1.0 5 1

Seq Scan on spd_kontrahenci_rodzaje1 b (cost=0.00..1.05 rows=5 width=45) (actual time=0.001..0.003 rows=5 loops=1)

40. 0.002 0.008 ↓ 1.6 21 1

Hash (cost=1.13..1.13 rows=13 width=45) (actual time=0.008..0.008 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
41. 0.006 0.006 ↓ 1.6 21 1

Seq Scan on spd_kontrahenci_rodzaje3 d (cost=0.00..1.13 rows=13 width=45) (actual time=0.002..0.006 rows=21 loops=1)

42. 0.015 0.027 ↓ 1.0 74 1

Hash (cost=2.73..2.73 rows=73 width=55) (actual time=0.027..0.027 rows=74 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 7kB
43. 0.012 0.012 ↓ 1.0 74 1

Seq Scan on spd_kontrahenci_grupy_rabatow e (cost=0.00..2.73 rows=73 width=55) (actual time=0.003..0.012 rows=74 loops=1)

44. 0.007 0.011 ↑ 1.0 22 1

Hash (cost=1.22..1.22 rows=22 width=105) (actual time=0.011..0.011 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 4kB
45. 0.004 0.004 ↑ 1.0 22 1

Seq Scan on spd_grupy_cennikowe f (cost=0.00..1.22 rows=22 width=105) (actual time=0.002..0.004 rows=22 loops=1)

46. 0.074 0.157 ↑ 1.0 317 1

Hash (cost=25.17..25.17 rows=317 width=65) (actual time=0.157..0.157 rows=317 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
47. 0.083 0.083 ↑ 1.0 317 1

Seq Scan on adm_uzytkownicy g (cost=0.00..25.17 rows=317 width=65) (actual time=0.003..0.083 rows=317 loops=1)

48. 4.204 26.006 ↓ 1.0 14,935 1

Hash (cost=2,937.07..2,937.07 rows=14,347 width=212) (actual time=26.006..26.006 rows=14,935 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 3564kB
49. 3.634 21.802 ↓ 1.0 14,935 1

Hash Left Join (cost=2,565.16..2,937.07 rows=14,347 width=212) (actual time=13.446..21.802 rows=14,935 loops=1)

  • Hash Cond: (spd_kontrahenci_hand_1.id_handlowca = b_1.kod)
50. 3.195 18.140 ↓ 1.0 14,935 1

Unique (cost=2,560.13..2,701.77 rows=14,347 width=12) (actual time=13.410..18.140 rows=14,935 loops=1)

51. 11.317 14.945 ↓ 1.0 28,386 1

Sort (cost=2,560.13..2,630.95 rows=28,328 width=12) (actual time=13.409..14.945 rows=28,386 loops=1)

  • Sort Key: spd_kontrahenci_hand_1.id_kontrahenta, spd_kontrahenci_hand_1.od_kiedy
  • Sort Method: quicksort Memory: 2099kB
52. 3.628 3.628 ↓ 1.0 28,386 1

Seq Scan on spd_kontrahenci_hand spd_kontrahenci_hand_1 (cost=0.00..465.28 rows=28,328 width=12) (actual time=0.007..3.628 rows=28,386 loops=1)

53. 0.013 0.028 ↓ 1.0 48 1

Hash (cost=4.46..4.46 rows=46 width=208) (actual time=0.028..0.028 rows=48 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
54. 0.015 0.015 ↓ 1.0 48 1

Seq Scan on spd_handlowcy b_1 (cost=0.00..4.46 rows=46 width=208) (actual time=0.004..0.015 rows=48 loops=1)

Total runtime : 1,913.741 ms