explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ARqR

Settings
# exclusive inclusive rows x rows loops node
1. 0.827 278,544.419 ↑ 1.0 1 1

Nested Loop Left Join (cost=48,390.64..150,913.39 rows=1 width=2,340) (actual time=278,544.407..278,544.419 rows=1 loops=1)

2.          

CTE slrdepartmenttemp

3. 8.988 550.045 ↓ 78.3 14,957 1

Recursive Union (cost=2.80..1,618.80 rows=191 width=12) (actual time=0.401..550.045 rows=14,957 loops=1)

4. 0.160 0.401 ↑ 1.0 1 1

Index Scan using pk_slrdepartment on slrdepartment t_2 (cost=2.80..7.53 rows=1 width=12) (actual time=0.399..0.401 rows=1 loops=1)

  • Index Cond: (id = '11541001'::numeric)
  • Filter: ($1 AND ((id <> ALL (adm_pfuncafi.gettblaccessforattr_notin(SESSION_USER, 'slrdepartment'::name, '-122001'::numeric))) OR (id IS NULL)))
5.          

Initplan (for Index Scan)

6. 0.241 0.241 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.241..0.241 rows=1 loops=1)

7. 12.958 540.656 ↓ 98.4 1,870 8

Nested Loop (cost=2.80..160.74 rows=19 width=12) (actual time=0.153..67.582 rows=1,870 loops=8)

8.          

Initplan (for Nested Loop)

9. 0.115 0.115 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.114..0.115 rows=1 loops=1)

10. 4.088 4.088 ↓ 187.0 1,870 8

WorkTable Scan on slrdepartmenttemp slrdepartmenttemp_2 (cost=0.00..0.20 rows=10 width=18) (actual time=0.001..0.511 rows=1,870 loops=8)

11. 523.495 523.495 ↑ 2.0 1 14,957

Index Only Scan using ak_slrdepartment_parent_id_br on slrdepartment t_3 (cost=0.29..15.78 rows=2 width=12) (actual time=0.011..0.035 rows=1 loops=14,957)

  • Index Cond: (idparent = slrdepartmenttemp_2.id)
  • Filter: ($2 AND ((id <> ALL (adm_pfuncafi.gettblaccessforattr_notin(SESSION_USER, 'slrdepartment'::name, '-122001'::numeric))) OR (id IS NULL)))
  • Rows Removed by Filter: 0
  • Heap Fetches: 14957
12.          

Initplan (for Nested Loop Left Join)

13. 0.117 0.117 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.116..0.117 rows=1 loops=1)

14. 0.124 0.124 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.124..0.124 rows=1 loops=1)

15. 0.112 0.112 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.111..0.112 rows=1 loops=1)

16. 0.101 0.101 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.101..0.101 rows=1 loops=1)

17. 0.135 0.135 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.134..0.135 rows=1 loops=1)

18. 0.144 0.144 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.143..0.144 rows=1 loops=1)

19. 0.010 278,542.290 ↑ 1.0 1 1

Nested Loop Left Join (cost=46,756.47..149,273.19 rows=1 width=1,613) (actual time=278,542.278..278,542.290 rows=1 loops=1)

20. 0.010 278,542.267 ↑ 1.0 1 1

Nested Loop (cost=46,756.19..149,270.70 rows=1 width=1,541) (actual time=278,542.256..278,542.267 rows=1 loops=1)

  • Join Filter: (t.idcategory = slrcategory.id)
  • Rows Removed by Join Filter: 2
21. 0.005 278,542.252 ↑ 1.0 1 1

Nested Loop (cost=46,756.19..149,269.61 rows=1 width=914) (actual time=278,542.241..278,542.252 rows=1 loops=1)

22. 0.005 278,541.990 ↑ 1.0 1 1

Nested Loop (cost=46,755.91..149,264.59 rows=1 width=893) (actual time=278,541.980..278,541.990 rows=1 loops=1)

23. 0.006 278,541.108 ↑ 1.0 1 1

Nested Loop (cost=46,755.49..149,259.44 rows=1 width=817) (actual time=278,541.098..278,541.108 rows=1 loops=1)

  • Join Filter: (slrcardaccept.idcardtype = slrcardtype.id)
24. 0.005 278,541.096 ↑ 1.0 1 1

Nested Loop (cost=46,755.49..149,258.32 rows=1 width=288) (actual time=278,541.086..278,541.096 rows=1 loops=1)

25. 0.017 278,540.954 ↑ 1.0 1 1

Nested Loop (cost=46,755.07..149,257.81 rows=1 width=246) (actual time=278,540.945..278,540.954 rows=1 loops=1)

26. 0.011 278,540.186 ↑ 1.0 1 1

Nested Loop (cost=46,754.66..149,247.83 rows=1 width=194) (actual time=278,540.177..278,540.186 rows=1 loops=1)

27. 0.656 278,539.539 ↑ 1.0 1 1

Nested Loop Left Join (cost=46,754.24..149,241.07 rows=1 width=192) (actual time=278,539.531..278,539.539 rows=1 loops=1)

28.          

Initplan (for Nested Loop Left Join)

29. 0.131 0.131 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.131..0.131 rows=1 loops=1)

30. 0.114 0.114 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.113..0.114 rows=1 loops=1)

31. 0.006 278,538.511 ↑ 1.0 1 1

Nested Loop Left Join (cost=46,748.79..149,231.40 rows=1 width=122) (actual time=278,538.503..278,538.511 rows=1 loops=1)

32. 0.000 278,538.319 ↑ 1.0 1 1

Nested Loop Left Join (cost=46,748.38..149,228.00 rows=1 width=124) (actual time=278,538.312..278,538.319 rows=1 loops=1)

33.          

Initplan (for Nested Loop Left Join)

34. 0.177 0.177 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.176..0.177 rows=1 loops=1)

35. 0.135 0.135 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.134..0.135 rows=1 loops=1)

36. 0.129 0.129 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.129..0.129 rows=1 loops=1)

37. 0.272 0.272 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.271..0.272 rows=1 loops=1)

38. 0.016 278,538.129 ↑ 1.0 1 1

Nested Loop Left Join (cost=46,738.04..149,215.62 rows=1 width=62) (actual time=278,538.125..278,538.129 rows=1 loops=1)

39. 0.004 278,537.903 ↑ 1.0 1 1

Nested Loop Left Join (cost=46,737.37..149,211.78 rows=1 width=53) (actual time=278,537.900..278,537.903 rows=1 loops=1)

40. 1.276 278,537.600 ↑ 1.0 1 1

Nested Loop Semi Join (cost=46,736.95..149,211.05 rows=1 width=36) (actual time=278,537.599..278,537.600 rows=1 loops=1)

  • Join Filter: (t.iddepartment = slrdepartmenttemp.id)
  • Rows Removed by Join Filter: 7176
41. 0.010 278,535.619 ↑ 4.0 1 1

Nested Loop (cost=46,736.95..149,191.95 rows=4 width=36) (actual time=278,535.618..278,535.619 rows=1 loops=1)

42. 0.000 278,534.492 ↑ 5,677.0 1 1

GroupAggregate (cost=46,736.53..124,663.05 rows=5,677 width=17) (actual time=278,534.492..278,534.492 rows=1 loops=1)

  • Group Key: t_1.idcard
43.          

Initplan (for GroupAggregate)

44. 0.345 0.345 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.344..0.345 rows=1 loops=1)

45. 0.194 0.194 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.193..0.194 rows=1 loops=1)

46. 0.337 0.337 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.336..0.337 rows=1 loops=1)

47. 0.027 278,533.785 ↑ 333.9 17 1

Nested Loop Left Join (cost=46,728.99..117,388.95 rows=5,677 width=34) (actual time=254,990.941..278,533.785 rows=17 loops=1)

48. 0.022 278,533.469 ↑ 333.9 17 1

Nested Loop (cost=46,728.57..114,698.69 rows=5,677 width=25) (actual time=254,990.716..278,533.469 rows=17 loops=1)

  • Join Filter: (slrmovement.idcard = t_1.idcard)
49. 34.085 278,522.312 ↑ 1,458.0 1 1

Nested Loop (cost=46,728.15..79,672.96 rows=1,458 width=18) (actual time=254,989.852..278,522.312 rows=1 loops=1)

50. 109.188 207,039.231 ↓ 9.0 52,691 1

Group (cost=46,727.73..46,757.04 rows=5,862 width=9) (actual time=206,815.688..207,039.231 rows=52,691 loops=1)

  • Group Key: slrmovement.idcard
51.          

Initplan (for Group)

52. 0.122 0.122 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.121..0.122 rows=1 loops=1)

53. 550.243 206,929.921 ↓ 53.7 314,645 1

Sort (cost=46,725.22..46,739.88 rows=5,862 width=9) (actual time=206,815.686..206,929.921 rows=314,645 loops=1)

  • Sort Key: slrmovement.idcard
  • Sort Method: external merge Disk: 5856kB
54. 263.269 206,379.678 ↓ 53.7 314,645 1

Nested Loop (cost=0.42..46,207.90 rows=5,862 width=9) (actual time=3.134..206,379.678 rows=314,645 loops=1)

55. 562.358 562.358 ↓ 78.3 14,957 1

CTE Scan on slrdepartmenttemp slrdepartmenttemp_1 (cost=0.00..3.82 rows=191 width=18) (actual time=0.402..562.358 rows=14,957 loops=1)

56. 205,554.051 205,554.051 ↑ 1.5 21 14,957

Index Scan using fk_slrmovement_department on slrmovement (cost=0.42..241.60 rows=31 width=16) (actual time=0.437..13.743 rows=21 loops=14,957)

  • Index Cond: (iddepartment = slrdepartmenttemp_1.id)
  • Filter: ($40 AND ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL)))
57. 4,320.662 71,448.996 ↓ 0.0 0 52,691

Index Scan using pk_slrcard on slrcard slrcard_1 (cost=0.42..5.61 rows=1 width=9) (actual time=1.356..1.356 rows=0 loops=52,691)

  • Index Cond: (id = slrmovement.idcard)
  • Filter: ($35 AND (alternatives: SubPlan 36 or hashed SubPlan 38) AND (instr((upper((stabnum)::text))::character varying, '00066190'::character varying) <> 0))
  • Rows Removed by Filter: 1
58.          

SubPlan (for Index Scan)

59. 67,128.200 67,128.334 ↑ 4.0 1 52,691

Index Scan using fk_slrmovement_card on slrmovement slrmovement_7 (cost=2.93..7.67 rows=4 width=0) (actual time=1.274..1.274 rows=1 loops=52,691)

  • Index Cond: ((idcard = slrcard_1.id) AND (idcard = slrcard_1.id))
  • Filter: ($37 AND ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL)))
  • Rows Removed by Filter: 1
60.          

Initplan (for Index Scan)

61. 0.134 0.134 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.134..0.134 rows=1 loops=1)

62. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on slrmovement slrmovement_8 (cost=3,542.12..922,393.42 rows=178,500 width=9) (never executed)

  • Recheck Cond: ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL))
  • Filter: $39
63.          

Initplan (for Bitmap Heap Scan)

64. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.51 rows=1 width=1) (never executed)

65. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=3,539.61..3,539.61 rows=357,012 width=0) (never executed)

66. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..3,448.73 rows=356,998 width=0) (never executed)

  • Index Cond: (iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric)))
67. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..1.63 rows=14 width=0) (never executed)

  • Index Cond: (iddepartment IS NULL)
68. 11.135 11.135 ↓ 4.2 17 1

Index Scan using fk_slrmovement_card on slrmovement t_1 (cost=0.42..23.97 rows=4 width=25) (actual time=0.857..11.135 rows=17 loops=1)

  • Index Cond: (idcard = slrcard_1.id)
  • Filter: ($33 AND ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL)))
69. 0.289 0.289 ↓ 0.0 0 17

Index Scan using fk_slrcardaccept_card on slrcardaccept slrcardaccept_2 (cost=0.42..0.46 rows=1 width=26) (actual time=0.017..0.017 rows=0 loops=17)

  • Index Cond: (t_1.idcard = idcard)
  • Filter: ($34 AND (t_1.dend = ddismissed))
  • Rows Removed by Filter: 1
70. 1.117 1.117 ↑ 1.0 1 1

Index Scan using ak_slrmovement_card_begin on slrmovement t (cost=0.42..4.31 rows=1 width=36) (actual time=1.117..1.117 rows=1 loops=1)

  • Index Cond: ((idcard = t_1.idcard) AND (dbegin = (COALESCE(max(CASE WHEN ((cmn.todate('31.12.2019 00:00:00'::character varying) >= t_1.dbegin) AND (cmn.todate('31.12.2019 00:00:00'::character varying) <= COALESCE(t_1.dend, cmn.todate('31.12.2019 00:00:00'::character varying)))) THEN t_1.dbegin ELSE NULL::timestamp without time zone END), max(CASE WHEN ((t_1.dbegin < cmn.todate('31.12.2019 00:00:00'::character varying)) AND (slrcardaccept_2.id IS NOT NULL)) THEN t_1.dbegin ELSE NULL::timestamp without time zone END), min(CASE WHEN (t_1.dbegin > cmn.todate('31.12.2019 00:00:00'::character varying)) THEN t_1.dbegin ELSE NULL::timestamp without time zone END)))))
  • Filter: ($32 AND ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL)))
71. 0.705 0.705 ↓ 37.6 7,177 1

CTE Scan on slrdepartmenttemp (cost=0.00..3.82 rows=191 width=18) (actual time=0.000..0.705 rows=7,177 loops=1)

72. 0.299 0.299 ↑ 1.0 1 1

Index Scan using fk_slrcardaccept_card on slrcardaccept slrcardaccept_1 (cost=0.42..0.72 rows=1 width=34) (actual time=0.298..0.299 rows=1 loops=1)

  • Index Cond: (t.idcard = idcard)
  • Filter: ($29 AND (t.dbegin >= dbeginwork) AND (t.dbegin <= COALESCE(ddismissed, cmn.todate('31.12.2019 00:00:00'::character varying))))
73. 0.210 0.210 ↑ 1.0 1 1

Index Scan using ak_slrcardgraphic_card_begin on slrcardgraphic slrcardgraphic_1 (cost=0.67..3.84 rows=1 width=18) (actual time=0.209..0.210 rows=1 loops=1)

  • Index Cond: ((t.idcard = idcard) AND (cmn.todate('31.12.2019 00:00:00'::character varying) >= dbegin))
  • Filter: ($30 AND (cmn.todate('31.12.2019 00:00:00'::character varying) <= COALESCE(dend, cmn.todate('31.12.2019 00:00:00'::character varying))))
  • Rows Removed by Filter: 3
74. 0.184 0.184 ↑ 1.0 1 1

Index Scan using fk_wpa_wppmove_slrcar on wpa_wppersonmovement (cost=0.29..1.06 rows=1 width=16) (actual time=0.181..0.184 rows=1 loops=1)

  • Index Cond: (t.idcard = idslrcard)
  • Filter: ($31 AND (cmn.todate('31.12.2019 00:00:00'::character varying) >= dbegindate) AND (cmn.todate('31.12.2019 00:00:00'::character varying) <= COALESCE(denddate, cmn.todate('31.12.2019 00:00:00'::character varying))))
75. 0.186 0.186 ↑ 1.0 1 1

Index Scan using pk_slrcardaccept on slrcardaccept (cost=0.42..3.39 rows=1 width=30) (actual time=0.185..0.186 rows=1 loops=1)

  • Index Cond: ((CASE WHEN (slrcardaccept_1.id IS NOT NULL) THEN slrcardaccept_1.id ELSE slrfnc.getidcardacceptext(t.idcard, t.dbegin, '1'::cmn.tboolean) END) = id)
  • Filter: ($27 AND (dbeginwork <= cmn.todate('31.12.2019 00:00:00'::character varying)) AND (COALESCE(ddismissed, cmn.todate('31.12.2019 00:00:00'::character varying)) >= cmn.todate('31.12.2019 00:00:00'::character varying)))
76. 0.127 0.127 ↑ 1.0 1 1

Index Scan using pk_slrcardgraphic on slrcardgraphic (cost=0.42..2.64 rows=1 width=16) (actual time=0.127..0.127 rows=1 loops=1)

  • Index Cond: ((CASE WHEN (slrcardgraphic_1.id IS NOT NULL) THEN slrcardgraphic_1.id ELSE slrfnc.getidcardgraphicext(t.idcard, cmn.todate('31.12.2019 00:00:00'::character varying), '1'::cmn.tboolean) END) = id)
  • Filter: $28
77. 0.140 0.636 ↑ 1.0 1 1

Index Scan using pk_slrcard on slrcard (cost=0.42..6.75 rows=1 width=75) (actual time=0.636..0.636 rows=1 loops=1)

  • Index Cond: (id = t.idcard)
  • Filter: ($5 AND (alternatives: SubPlan 6 or hashed SubPlan 8))
78.          

SubPlan (for Index Scan)

79. 0.402 0.496 ↑ 4.0 1 1

Index Scan using fk_slrmovement_card on slrmovement slrmovement_1 (cost=2.93..7.67 rows=4 width=0) (actual time=0.496..0.496 rows=1 loops=1)

  • Index Cond: ((idcard = slrcard.id) AND (idcard = slrcard.id))
  • Filter: ($7 AND ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL)))
80.          

Initplan (for Index Scan)

81. 0.094 0.094 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.094..0.094 rows=1 loops=1)

82. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on slrmovement slrmovement_2 (cost=3,542.12..922,393.42 rows=178,500 width=9) (never executed)

  • Recheck Cond: ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL))
  • Filter: $9
83.          

Initplan (for Bitmap Heap Scan)

84. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.51 rows=1 width=1) (never executed)

85. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=3,539.61..3,539.61 rows=357,012 width=0) (never executed)

86. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..3,448.73 rows=356,998 width=0) (never executed)

  • Index Cond: (iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric)))
87. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..1.63 rows=14 width=0) (never executed)

  • Index Cond: (iddepartment IS NULL)
88. 0.145 0.751 ↑ 1.0 1 1

Index Scan using pk_slrkadr on slrkadr (cost=0.42..9.98 rows=1 width=60) (actual time=0.751..0.751 rows=1 loops=1)

  • Index Cond: (id = slrcard.idkadr)
  • Filter: ($10 AND ((alternatives: SubPlan 15 or hashed SubPlan 21) OR ((lworker)::text = 'N'::text)))
89.          

SubPlan (for Index Scan)

90. 0.017 0.606 ↑ 1.0 1 1

Index Scan using fk_slrcard_kadr on slrcard slrcard_2 (cost=2.93..9.27 rows=1 width=0) (actual time=0.606..0.606 rows=1 loops=1)

  • Index Cond: (idkadr = slrkadr.id)
  • Filter: ($12 AND (alternatives: SubPlan 12 or hashed SubPlan 14))
91.          

Initplan (for Index Scan)

92. 0.114 0.114 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.113..0.114 rows=1 loops=1)

93.          

SubPlan (for Index Scan)

94. 0.370 0.475 ↑ 4.0 1 1

Index Scan using fk_slrmovement_card on slrmovement slrmovement_3 (cost=2.93..7.67 rows=4 width=0) (actual time=0.475..0.475 rows=1 loops=1)

  • Index Cond: ((idcard = slrcard_2.id) AND (idcard = slrcard_2.id))
  • Filter: ($14 AND ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL)))
95.          

Initplan (for Index Scan)

96. 0.105 0.105 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.104..0.105 rows=1 loops=1)

97. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on slrmovement slrmovement_4 (cost=3,542.12..922,393.42 rows=178,500 width=9) (never executed)

  • Recheck Cond: ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL))
  • Filter: $16
98.          

Initplan (for Bitmap Heap Scan)

99. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.51 rows=1 width=1) (never executed)

100. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=3,539.61..3,539.61 rows=357,012 width=0) (never executed)

101. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..3,448.73 rows=356,998 width=0) (never executed)

  • Index Cond: (iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric)))
102. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..1.63 rows=14 width=0) (never executed)

  • Index Cond: (iddepartment IS NULL)
103. 0.000 0.000 ↓ 0.0 0

Seq Scan on slrcard slrcard_3 (cost=2.51..399,391.74 rows=23,915 width=8) (never executed)

  • Filter: ($18 AND (alternatives: SubPlan 18 or hashed SubPlan 20))
104.          

Initplan (for Seq Scan)

105. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.51 rows=1 width=1) (never executed)

106.          

SubPlan (for Seq Scan)

107. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_slrmovement_card on slrmovement slrmovement_5 (cost=2.93..7.67 rows=4 width=0) (never executed)

  • Index Cond: ((idcard = slrcard_3.id) AND (idcard = slrcard_3.id))
  • Filter: ($20 AND ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL)))
108.          

Initplan (for Index Scan)

109. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.51 rows=1 width=1) (never executed)

110. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on slrmovement slrmovement_6 (cost=3,542.12..922,393.42 rows=178,500 width=9) (never executed)

  • Recheck Cond: ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL))
  • Filter: $22
111.          

Initplan (for Bitmap Heap Scan)

112. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.51 rows=1 width=1) (never executed)

113. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=3,539.61..3,539.61 rows=357,012 width=0) (never executed)

114. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..3,448.73 rows=356,998 width=0) (never executed)

  • Index Cond: (iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric)))
115. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..1.63 rows=14 width=0) (never executed)

  • Index Cond: (iddepartment IS NULL)
116. 0.137 0.137 ↑ 1.0 1 1

Index Scan using pk_slrworker on slrworker (cost=0.42..0.51 rows=1 width=51) (actual time=0.137..0.137 rows=1 loops=1)

  • Index Cond: (id = slrcard.idworker)
  • Filter: $23
117. 0.006 0.006 ↑ 5.0 1 1

Seq Scan on slrcardtype (cost=0.00..1.05 rows=5 width=534) (actual time=0.006..0.006 rows=1 loops=1)

118. 0.877 0.877 ↑ 1.0 1 1

Index Scan using pk_slrstaffpos on slrstaffpos (cost=0.42..5.15 rows=1 width=83) (actual time=0.877..0.877 rows=1 loops=1)

  • Index Cond: (id = t.idstaffpos)
  • Filter: ($24 AND ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrstaffpos'::name, '962001'::numeric))) OR (iddepartment IS NULL)))
119. 0.257 0.257 ↑ 1.0 1 1

Index Scan using pk_slrdepartment on slrdepartment (cost=0.29..5.02 rows=1 width=28) (actual time=0.257..0.257 rows=1 loops=1)

  • Index Cond: (id = t.iddepartment)
  • Filter: ($25 AND ((id <> ALL (adm_pfuncafi.gettblaccessforattr_notin(SESSION_USER, 'slrdepartment'::name, '-122001'::numeric))) OR (id IS NULL)))
120. 0.005 0.005 ↑ 1.3 3 1

Seq Scan on slrcategory (cost=0.00..1.04 rows=4 width=632) (actual time=0.005..0.005 rows=3 loops=1)

121. 0.013 0.013 ↑ 1.0 1 1

Index Scan using pk_slrgraphic on slrgraphic (cost=0.28..2.50 rows=1 width=79) (actual time=0.013..0.013 rows=1 loops=1)

  • Index Cond: (id = slrcardgraphic.idgraphic)
122. 0.569 0.569 ↑ 1.0 1 1

Index Scan using pk_wpa_workplacehistory on wpa_workplacehistory (cost=0.29..5.02 rows=1 width=23) (actual time=0.569..0.569 rows=1 loops=1)

  • Index Cond: (id = (CASE WHEN (wpa_wppersonmovement.idworkplacehistory IS NOT NULL) THEN wpa_wppersonmovement.idworkplacehistory ELSE wpa_wppersonmovementapi.getworkplacehistcarddate(t.idcard, COALESCE(slrcardaccept_1.ddismissed, cmn.todate('31.12.2019 00:00:00'::character varying)), '0'::cmn.tboolean) END))
  • Filter: ($26 AND ((idslrdepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'wpa_workplacehistory'::name, '1102001'::numeric))) OR (idslrdepartment IS NULL)))
Planning time : 1,156.973 ms
Execution time : 278,550.026 ms