explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XulU

Settings
# exclusive inclusive rows x rows loops node
1. 1,425.149 1,991.179 ↑ 1.2 18,708 1

Hash Right Join (cost=46,169.70..646,939.25 rows=22,440 width=1,873) (actual time=216.851..1,991.179 rows=18,708 loops=1)

  • Hash Cond: (j.id_kontrahenta = a.id_kontrahenta)
2. 26.887 106.176 ↑ 1.1 18,709 1

Merge Right Join (cost=10,461.91..10,983.12 rows=20,705 width=125) (actual time=74.687..106.176 rows=18,709 loops=1)

  • Merge Cond: ((btrim((i.kraj)::text)) = (btrim((j.pole_s1)::text)))
3. 0.348 0.572 ↑ 1.0 238 1

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

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

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

5. 20.974 78.717 ↓ 1.1 18,709 1

Sort (cost=10,361.08..10,404.39 rows=17,326 width=258) (actual time=74.129..78.717 rows=18,709 loops=1)

  • Sort Key: (btrim((j.pole_s1)::text))
  • Sort Method: quicksort Memory: 10415kB
6. 56.025 57.743 ↓ 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.196..57.743 rows=18,709 loops=1)

  • Recheck Cond: (rodzaj_info = 28)
7. 1.718 1.718 ↓ 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.718..1.718 rows=18,709 loops=1)

  • Index Cond: (rodzaj_info = 28)
8. 37.194 141.818 ↑ 1.0 18,708 1

Hash (cost=35,473.07..35,473.07 rows=18,778 width=1,752) (actual time=141.818..141.818 rows=18,708 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 31235kB
9. 12.041 104.624 ↑ 1.0 18,708 1

Hash Left Join (cost=3,153.63..35,473.07 rows=18,778 width=1,752) (actual time=25.880..104.624 rows=18,708 loops=1)

  • Hash Cond: (a.id_kontrahenta = spd_kontrahenci_hand.id_kontrahenta)
10. 6.644 66.975 ↑ 1.0 18,708 1

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

  • Hash Cond: (a.kto = g.id_uzytkownika)
11. 6.302 60.178 ↑ 1.0 18,708 1

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

  • Hash Cond: (a.id_grupy_cennik = f.id)
12. 5.746 53.866 ↑ 1.0 18,708 1

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

  • Hash Cond: (a.grupa_rabatowa = e.id_grupy)
13. 5.835 48.093 ↑ 1.0 18,708 1

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

  • Hash Cond: (a.id_rodzaju3 = d.id_rodzaju)
14. 6.132 42.248 ↑ 1.0 18,708 1

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

  • Hash Cond: (a.id_rodzaju1 = b.id_rodzaju)
15. 20.999 36.111 ↑ 1.0 18,708 1

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

  • Merge Cond: (c.id_rodzaju = a.id_rodzaju2)
16. 0.011 0.011 ↓ 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.011 rows=9 loops=1)

17. 15.101 15.101 ↑ 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.101 rows=18,708 loops=1)

18. 0.003 0.005 ↑ 1.0 5 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
19. 0.002 0.002 ↑ 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.002 rows=5 loops=1)

20. 0.003 0.010 ↓ 1.6 21 1

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

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

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

22. 0.021 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
23. 0.006 0.006 ↓ 1.0 74 1

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

24. 0.008 0.010 ↑ 1.0 22 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 4kB
25. 0.002 0.002 ↑ 1.0 22 1

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

26. 0.072 0.153 ↑ 1.0 317 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
27. 0.081 0.081 ↑ 1.0 317 1

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

28. 4.286 25.608 ↓ 1.0 14,935 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 3564kB
29. 3.569 21.322 ↓ 1.0 14,935 1

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

  • Hash Cond: (spd_kontrahenci_hand.id_handlowca = b_1.kod)
30. 3.066 17.725 ↓ 1.0 14,935 1

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

31. 11.291 14.659 ↓ 1.0 28,386 1

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

  • Sort Key: spd_kontrahenci_hand.id_kontrahenta, spd_kontrahenci_hand.od_kiedy
  • Sort Method: quicksort Memory: 2099kB
32. 3.368 3.368 ↓ 1.0 28,386 1

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

33. 0.014 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
34. 0.014 0.014 ↓ 1.0 48 1

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

35.          

SubPlan (for Hash Right Join)

36. 43.629 243.204 ↑ 1.0 1 18,708

Nested Loop Left Join (cost=4.88..16.83 rows=1 width=259) (actual time=0.012..0.013 rows=1 loops=18,708)

37. 24.921 187.080 ↑ 1.0 1 18,708

Nested Loop Left Join (cost=4.75..16.52 rows=1 width=208) (actual time=0.009..0.010 rows=1 loops=18,708)

38. 6.144 149.664 ↑ 1.0 1 18,708

Nested Loop (cost=4.61..12.35 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=18,708)

  • Join Filter: (r.od_kiedy = (max(spd_kontrahenci_hand_1.od_kiedy)))
  • Rows Removed by Join Filter: 1
39. 37.416 93.540 ↑ 2.0 1 18,708

GroupAggregate (cost=2.30..6.15 rows=2 width=8) (actual time=0.005..0.005 rows=1 loops=18,708)

40. 18.708 56.124 ↑ 2.0 1 18,708

Bitmap Heap Scan on spd_kontrahenci_hand spd_kontrahenci_hand_1 (cost=2.30..6.12 rows=2 width=8) (actual time=0.003..0.003 rows=1 loops=18,708)

  • Recheck Cond: (id_kontrahenta = a.id_platnika)
41. 37.416 37.416 ↑ 2.0 1 18,708

Bitmap Index Scan on spd_hak_auto (cost=0.00..2.30 rows=2 width=0) (actual time=0.002..0.002 rows=1 loops=18,708)

  • Index Cond: (id_kontrahenta = a.id_platnika)
42. 12.495 49.980 ↑ 1.0 2 12,495

Materialize (cost=2.30..6.13 rows=2 width=12) (actual time=0.003..0.004 rows=2 loops=12,495)

43. 12.495 37.485 ↑ 1.0 2 12,495

Bitmap Heap Scan on spd_kontrahenci_hand r (cost=2.30..6.12 rows=2 width=12) (actual time=0.002..0.003 rows=2 loops=12,495)

  • Recheck Cond: (id_kontrahenta = a.id_platnika)
44. 24.990 24.990 ↑ 1.0 2 12,495

Bitmap Index Scan on spd_hak_auto (cost=0.00..2.30 rows=2 width=0) (actual time=0.002..0.002 rows=2 loops=12,495)

  • Index Cond: (id_kontrahenta = a.id_platnika)
45. 12.495 12.495 ↑ 1.0 1 12,495

Index Scan using spd_han_auto on spd_handlowcy s (cost=0.14..4.16 rows=1 width=212) (actual time=0.001..0.001 rows=1 loops=12,495)

  • Index Cond: (r.id_handlowca = kod)
46. 12.495 12.495 ↑ 1.0 1 12,495

Index Scan using spd_hsi_auto on spd_handlowcy_sieci t (cost=0.14..0.28 rows=1 width=55) (actual time=0.001..0.001 rows=1 loops=12,495)

  • Index Cond: (s.id_sieci = id)
47. 56.124 56.124 ↑ 1.0 1 18,708

Index Scan using spd_kin_sort_kontrahent on spd_kontrahenci_info_dodatkow (cost=0.42..4.44 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=18,708)

  • Index Cond: ((id_kontrahenta = a.id_kontrahenta) AND (rodzaj_info = 1))
48. 18.708 18.708 ↓ 0.0 0 18,708

Index Scan using spd_kin_sort_kontrahent on spd_kontrahenci_info_dodatkow spd_kontrahenci_info_dodatkow_1 (cost=0.42..4.44 rows=1 width=254) (actual time=0.001..0.001 rows=0 loops=18,708)

  • Index Cond: ((id_kontrahenta = a.id_kontrahenta) AND (rodzaj_info = 75))
Total runtime : 1,993.039 ms