explain.depesz.com

A tool for finding a real cause for slow queries.

Result: OPp

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 40.029 4,034.314 ↓ 12,541.0 12,541 1

Unique (cost=10,535.46..10,535.46 rows=1 width=1,564) (actual time=3,978.991..4,034.314 rows=12,541 loops=1)

2. 96.819 3,994.285 ↓ 12,572.0 12,572 1

Sort (cost=10,535.46..10,535.46 rows=1 width=1,564) (actual time=3,978.986..3,994.285 rows=12,572 loops=1)

  • Sort Key: r.id
  • Sort Method: quicksort Memory: 6524kB
3. 562.231 3,897.466 ↓ 12,572.0 12,572 1

Nested Loop (cost=8,713.03..10,535.45 rows=1 width=1,564) (actual time=481.278..3,897.466 rows=12,572 loops=1)

  • Join Filter: (r.userstatus = rus.id)
4. 66.465 1,762.349 ↓ 12,803.0 12,803 1

Nested Loop (cost=8,713.03..10,481.23 rows=1 width=1,568) (actual time=480.798..1,762.349 rows=12,803 loops=1)

5. 69.266 1,580.657 ↓ 12,803.0 12,803 1

Nested Loop (cost=8,713.03..10,479.16 rows=1 width=1,478) (actual time=480.770..1,580.657 rows=12,803 loops=1)

6. 51.407 1,434.573 ↓ 12,803.0 12,803 1

Nested Loop Left Join (cost=8,713.03..10,478.88 rows=1 width=1,208) (actual time=480.751..1,434.573 rows=12,803 loops=1)

7. 60.615 1,357.560 ↓ 12,803.0 12,803 1

Nested Loop Left Join (cost=8,713.03..10,478.53 rows=1 width=1,200) (actual time=480.743..1,357.560 rows=12,803 loops=1)

8. 63.407 1,233.115 ↓ 12,766.0 12,766 1

Nested Loop (cost=8,713.03..10,478.20 rows=1 width=1,200) (actual time=480.719..1,233.115 rows=12,766 loops=1)

9. 71.329 1,074.921 ↓ 13,541.0 13,541 1

Nested Loop (cost=8,713.03..10,477.92 rows=1 width=656) (actual time=480.681..1,074.921 rows=13,541 loops=1)

10. 63.867 841.088 ↓ 13,542.0 13,542 1

Hash Join (cost=8,675.69..10,440.16 rows=1 width=629) (actual time=474.435..841.088 rows=13,542 loops=1)

  • Hash Cond: ((child.person = kins.child) AND (p.person = kins.padre))
11. 39.554 713.971 ↓ 1.2 13,541 1

Hash Left Join (cost=7,858.46..9,128.87 rows=10,979 width=633) (actual time=411.139..713.971 rows=13,541 loops=1)

  • Hash Cond: (kr.microdistrict = md.id)
12. 37.990 674.413 ↓ 1.2 13,541 1

Hash Left Join (cost=7,842.84..9,072.06 rows=10,979 width=359) (actual time=411.115..674.413 rows=13,541 loops=1)

  • Hash Cond: (kr.healthgroup = hg.id)
13. 72.906 636.388 ↓ 1.2 13,541 1

Hash Join (cost=7,841.70..9,029.67 rows=10,979 width=89) (actual time=411.028..636.388 rows=13,541 loops=1)

  • Hash Cond: (p.initial = i.id)
14. 74.930 336.244 ↓ 1.2 13,541 1

Hash Join (cost=2,021.20..2,975.86 rows=10,979 width=44) (actual time=183.718..336.244 rows=13,541 loops=1)

  • Hash Cond: (child.request = p.request)
15. 49.269 81.377 ↓ 1.1 17,347 1

Nested Loop (cost=263.50..991.76 rows=15,387 width=12) (actual time=3.740..81.377 rows=17,347 loops=1)

16. 0.021 0.021 ↑ 1.0 1 1

Seq Scan on participanttypes childt (cost=0.00..1.05 rows=1 width=4) (actual time=0.017..0.021 rows=1 loops=1)

  • Filter: ((sysname)::text = 'child'::text)
17. 28.531 32.087 ↓ 1.1 17,347 1

Bitmap Heap Scan on participants child (cost=263.50..798.37 rows=15,387 width=16) (actual time=3.705..32.087 rows=17,347 loops=1)

  • Recheck Cond: (child.type = childt.id)
18. 3.556 3.556 ↓ 1.1 17,347 1

Bitmap Index Scan on participants_type_idx (cost=0.00..259.66 rows=15,387 width=0) (actual time=3.556..3.556 rows=17,347 loops=1)

  • Index Cond: (child.type = childt.id)
19. 23.650 179.937 ↓ 1.1 13,541 1

Hash (cost=1,603.12..1,603.12 rows=12,366 width=32) (actual time=179.937..179.937 rows=13,541 loops=1)

20. 53.367 156.287 ↓ 1.1 13,541 1

Hash Join (cost=1,184.10..1,603.12 rows=12,366 width=32) (actual time=85.044..156.287 rows=13,541 loops=1)

  • Hash Cond: (kr.id = p.request)
21. 17.919 17.919 ↑ 1.0 13,553 1

Seq Scan on kindergartenrequests kr (cost=0.00..208.29 rows=13,929 width=16) (actual time=0.014..17.919 rows=13,553 loops=1)

22. 23.435 85.001 ↓ 1.1 17,347 1

Hash (cost=991.76..991.76 rows=15,387 width=16) (actual time=85.001..85.001 rows=17,347 loops=1)

23. 36.281 61.566 ↓ 1.1 17,347 1

Nested Loop (cost=263.50..991.76 rows=15,387 width=16) (actual time=3.207..61.566 rows=17,347 loops=1)

24. 0.019 0.019 ↑ 1.0 1 1

Seq Scan on participanttypes pt (cost=0.00..1.05 rows=1 width=4) (actual time=0.011..0.019 rows=1 loops=1)

  • Filter: ((sysname)::text = 'applicant'::text)
25. 22.188 25.266 ↓ 1.1 17,347 1

Bitmap Heap Scan on participants p (cost=263.50..798.37 rows=15,387 width=20) (actual time=3.182..25.266 rows=17,347 loops=1)

  • Recheck Cond: (p.type = pt.id)
26. 3.078 3.078 ↓ 1.1 17,347 1

Bitmap Index Scan on participants_type_idx (cost=0.00..259.66 rows=15,387 width=0) (actual time=3.078..3.078 rows=17,347 loops=1)

  • Index Cond: (p.type = pt.id)
27. 108.351 227.238 ↓ 1.0 55,892 1

Hash (cost=5,129.67..5,129.67 rows=55,267 width=53) (actual time=227.238..227.238 rows=55,892 loops=1)

28. 118.887 118.887 ↓ 1.0 55,892 1

Seq Scan on initials i (cost=0.00..5,129.67 rows=55,267 width=53) (actual time=0.017..118.887 rows=55,892 loops=1)

29. 0.013 0.035 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=278) (actual time=0.035..0.035 rows=6 loops=1)

30. 0.022 0.022 ↑ 1.0 6 1

Seq Scan on healthgroups hg (cost=0.00..1.06 rows=6 width=278) (actual time=0.011..0.022 rows=6 loops=1)

31. 0.002 0.004 ↓ 0.0 0 1

Hash (cost=12.50..12.50 rows=250 width=278) (actual time=0.004..0.004 rows=0 loops=1)

32. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on microdistricts md (cost=0.00..12.50 rows=250 width=278) (actual time=0.002..0.002 rows=0 loops=1)

33. 31.659 63.250 ↑ 1.0 26,221 1

Hash (cost=414.49..414.49 rows=26,849 width=12) (actual time=63.250..63.250 rows=26,221 loops=1)

34. 31.591 31.591 ↑ 1.0 26,221 1

Seq Scan on kins (cost=0.00..414.49 rows=26,849 width=12) (actual time=0.028..31.591 rows=26,221 loops=1)

35. 159.684 162.504 ↑ 1.0 1 13,542

Index Scan using requests_pkey on requests r (cost=37.34..37.74 rows=1 width=35) (actual time=0.010..0.012 rows=1 loops=13,542)

  • Index Cond: (r.id = p.request)
  • Filter: (NOT (hashed SubPlan 5))
36.          

SubPlan (forIndex Scan)

37. 2.820 2.820 ↓ 1.1 1,986 1

Seq Scan on aspectinactive (cost=0.00..32.67 rows=1,867 width=4) (actual time=0.019..2.820 rows=1,986 loops=1)

38. 94.787 94.787 ↑ 1.0 1 13,541

Index Scan using requeststatuses_pkey on requeststatuses rs (cost=0.00..0.27 rows=1 width=552) (actual time=0.005..0.007 rows=1 loops=13,541)

  • Index Cond: (rs.id = r.status)
  • Filter: ((rs.sysname)::text <> 'rejected'::text)
39. 63.830 63.830 ↓ 0.0 0 12,766

Index Scan using document2participant_participant_idx on document2participant d2p (cost=0.00..0.31 rows=2 width=8) (actual time=0.005..0.005 rows=0 loops=12,766)

  • Index Cond: (d2p.participant = p.id)
40. 25.606 25.606 ↓ 0.0 0 12,803

Index Scan using documents_pkey on documents d (cost=0.00..0.33 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=12,803)

  • Index Cond: (d2p.document = d.id)
41. 76.818 76.818 ↑ 1.0 1 12,803

Index Scan using kintypes_pkey on kintypes (cost=0.00..0.27 rows=1 width=278) (actual time=0.004..0.006 rows=1 loops=12,803)

  • Index Cond: (kintypes.id = kins.type)
42. 115.227 115.227 ↑ 1.0 1 12,803

Index Scan using initials_pkey on initials ichild (cost=0.00..2.06 rows=1 width=98) (actual time=0.007..0.009 rows=1 loops=12,803)

  • Index Cond: (ichild.id = child.initial)
43. 76.818 76.818 ↑ 1.0 1 12,803

Seq Scan on requestuserstatuses rus (cost=0.00..1.02 rows=1 width=4) (actual time=0.003..0.006 rows=1 loops=12,803)

  • Filter: ((rus.sysname)::text <> 'rejected'::text)
44.          

SubPlan (forNested Loop)

45. 184.664 377.160 ↓ 0.0 0 12,572

Hash Join (cost=8.28..9.65 rows=1 width=274) (actual time=0.023..0.030 rows=0 loops=12,572)

  • Hash Cond: (b.id = b2kr.bonus)
46. 66.776 66.776 ↑ 1.0 26 1,964

Seq Scan on bonuses b (cost=0.00..1.26 rows=26 width=278) (actual time=0.004..0.034 rows=26 loops=1,964)

47. 37.716 125.720 ↓ 0.0 0 12,572

Hash (cost=8.27..8.27 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=12,572)

48. 88.004 88.004 ↓ 0.0 0 12,572

Index Scan using bonus2kindergartenrequest_kindergartenrequest_idx on bonus2kindergartenrequest b2kr (cost=0.00..8.27 rows=1 width=4) (actual time=0.007..0.007 rows=0 loops=12,572)

  • Index Cond: (kindergartenrequest = $0)
49. 118.792 326.872 ↑ 1.0 1 12,572

Nested Loop (cost=0.00..16.55 rows=1 width=27) (actual time=0.018..0.026 rows=1 loops=12,572)

50. 100.576 100.576 ↑ 1.0 1 12,572

Index Scan using preferkindergartens_kindergartenrequest_idx on preferkindergartens pkg (cost=0.00..8.27 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=12,572)

  • Index Cond: (kindergartenrequest = $0)
51. 107.504 107.504 ↑ 1.0 1 13,438

Index Scan using workareas_pkey on workareas w (cost=0.00..8.27 rows=1 width=31) (actual time=0.006..0.008 rows=1 loops=13,438)

  • Index Cond: (w.id = pkg.kindergarten)
52. 94.514 289.156 ↑ 1.0 1 12,572

Nested Loop (cost=0.00..16.55 rows=1 width=4) (actual time=0.016..0.023 rows=1 loops=12,572)

53. 100.576 100.576 ↑ 1.0 1 12,572

Index Scan using preferkindergartens_kindergartenrequest_idx on preferkindergartens pkg (cost=0.00..8.27 rows=1 width=4) (actual time=0.006..0.008 rows=1 loops=12,572)

  • Index Cond: (kindergartenrequest = $0)
54. 94.066 94.066 ↑ 1.0 1 13,438

Index Scan using workareas_pkey on workareas w (cost=0.00..8.27 rows=1 width=4) (actual time=0.005..0.007 rows=1 loops=13,438)

  • Index Cond: (w.id = pkg.kindergarten)
55. 62.860 502.880 ↑ 1.0 1 12,572

Aggregate (cost=10.39..10.40 rows=1 width=4) (actual time=0.039..0.040 rows=1 loops=12,572)

56. 73.878 440.020 ↓ 0.0 0 12,572

Nested Loop (cost=8.28..10.39 rows=1 width=4) (actual time=0.027..0.035 rows=0 loops=12,572)

57. 174.056 352.016 ↓ 0.0 0 12,572

Hash Join (cost=8.28..9.65 rows=1 width=4) (actual time=0.021..0.028 rows=0 loops=12,572)

  • Hash Cond: (b.id = b2kr.bonus)
58. 64.812 64.812 ↑ 1.0 26 1,964

Seq Scan on bonuses b (cost=0.00..1.26 rows=26 width=8) (actual time=0.003..0.033 rows=26 loops=1,964)

59. 37.716 113.148 ↓ 0.0 0 12,572

Hash (cost=8.27..8.27 rows=1 width=4) (actual time=0.009..0.009 rows=0 loops=12,572)

60. 75.432 75.432 ↓ 0.0 0 12,572

Index Scan using bonus2kindergartenrequest_kindergartenrequest_idx on bonus2kindergartenrequest b2kr (cost=0.00..8.27 rows=1 width=4) (actual time=0.006..0.006 rows=0 loops=12,572)

  • Index Cond: (kindergartenrequest = $0)
61. 14.126 14.126 ↑ 1.0 1 2,018

Index Scan using bonustypes_pkey on bonustypes bt (cost=0.00..0.73 rows=1 width=8) (actual time=0.005..0.007 rows=1 loops=2,018)

  • Index Cond: (bt.id = b.type)