explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YAPw

Settings
# exclusive inclusive rows x rows loops node
1. 4.308 9,949.023 ↑ 236.0 1 1

Result (cost=25,376.28..27,418.86 rows=236 width=12,363) (actual time=9,949.021..9,949.023 rows=1 loops=1)

2.          

CTE slrdepartmentrecurs

3. 12.848 2,732.366 ↓ 77.1 13,176 1

Recursive Union (cost=2.80..1,619.17 rows=171 width=97) (actual time=0.572..2,732.366 rows=13,176 loops=1)

4. 0.329 0.590 ↑ 1.0 1 1

Index Scan using pk_slrdepartment on slrdepartment t_1 (cost=2.80..7.53 rows=1 width=97) (actual time=0.569..0.590 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.261 0.261 ↑ 1.0 1 1

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

7. 14.137 2,718.928 ↓ 96.9 1,647 8

Nested Loop (cost=2.80..160.82 rows=17 width=97) (actual time=0.314..339.866 rows=1,647 loops=8)

8.          

Initplan (for Nested Loop)

9. 0.135 0.135 ↑ 1.0 1 1

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

10. 3.576 3.576 ↓ 164.7 1,647 8

WorkTable Scan on slrdepartmentrecurs (cost=0.00..0.20 rows=10 width=18) (actual time=0.000..0.447 rows=1,647 loops=8)

11. 2,701.080 2,701.080 ↑ 2.0 1 13,176

Index Scan using ak_slrdepartment_parent_id_br on slrdepartment t_2 (cost=0.29..15.79 rows=2 width=97) (actual time=0.049..0.205 rows=1 loops=13,176)

  • Index Cond: (idparent = slrdepartmentrecurs.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
12.          

CTE slrstaffpostemp

13. 13.892 9,932.769 ↑ 236.0 1 1

Nested Loop (cost=6.20..6,159.95 rows=236 width=1,621) (actual time=263.424..9,932.769 rows=1 loops=1)

14.          

Initplan (for Nested Loop)

15. 0.164 0.164 ↑ 1.0 1 1

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

16. 2,750.969 2,750.969 ↓ 77.1 13,176 1

CTE Scan on slrdepartmentrecurs r (cost=0.00..3.42 rows=171 width=534) (actual time=0.573..2,750.969 rows=13,176 loops=1)

17. 7,167.428 7,167.744 ↓ 0.0 0 13,176

Index Scan using fk_slrstaffpos_department on slrstaffpos t_3 (cost=3.69..35.96 rows=1 width=1,589) (actual time=0.544..0.544 rows=0 loops=13,176)

  • Index Cond: (iddepartment = r.id)
  • Filter: ($6 AND ((NOT (hashed SubPlan 4)) OR (iddepartment IS NULL)) AND (dbegin <= cmn.todate('31.01.2020 00:00:00'::character varying)) AND (instr((upper((smnemocode)::text))::character varying, '50344533'::character varying) <> 0) AND (COALESCE(dend, cmn.todate('31.01.2020 00:00:00'::character varying)) >= cmn.todate('01.01.2020 00:00:00'::character varying)))
  • Rows Removed by Filter: 9
18.          

SubPlan (for Index Scan)

19. 0.316 0.316 ↓ 19.1 1,907 1

ProjectSet (cost=0.00..3.02 rows=100 width=32) (actual time=0.155..0.316 rows=1,907 loops=1)

20. 0.000 0.000 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=1)

21.          

Initplan (for Result)

22. 0.231 0.231 ↑ 1.0 1 1

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

23. 0.153 0.153 ↑ 1.0 1 1

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

24. 0.116 0.116 ↑ 1.0 1 1

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

25. 0.111 0.111 ↑ 1.0 1 1

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

26. 0.158 0.158 ↑ 1.0 1 1

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

27. 0.034 9,943.946 ↑ 236.0 1 1

Sort (cost=17,584.60..17,585.19 rows=236 width=1,925) (actual time=9,943.945..9,943.946 rows=1 loops=1)

  • Sort Key: t.slevel
  • Sort Method: quicksort Memory: 25kB
28. 0.285 9,943.912 ↑ 236.0 1 1

Hash Left Join (cost=10,630.22..17,568.55 rows=236 width=1,925) (actual time=9,941.953..9,943.912 rows=1 loops=1)

  • Hash Cond: (t.id = people.idstaffpos)
29. 9,669.588 9,943.627 ↑ 236.0 1 1

Hash Left Join (cost=13.29..6,937.42 rows=236 width=1,632) (actual time=9,941.669..9,943.627 rows=1 loops=1)

  • Hash Cond: (t.id = tempfree.idstaffpos)
30. 3.505 274.039 ↑ 236.0 1 1

Nested Loop Left Join (cost=1.24..6,924.74 rows=236 width=1,600) (actual time=272.082..274.039 rows=1 loops=1)

  • Join Filter: ((sl.idtarifnet = slrtariflist.idtarifnet) AND (sl.nrank = slrtarif.nrank))
  • Rows Removed by Join Filter: 267
31. 0.054 270.534 ↑ 236.0 1 1

Nested Loop Left Join (cost=0.57..5,485.55 rows=236 width=1,596) (actual time=268.578..270.534 rows=1 loops=1)

  • Join Filter: ((sl.idscalewages = slrscalewageshist.idscalewages) AND (sl.nranksw = slrscalewageslist.nranksw))
  • Rows Removed by Join Filter: 164
32. 0.010 264.728 ↑ 236.0 1 1

Nested Loop Left Join (cost=0.42..5,117.38 rows=236 width=1,584) (actual time=264.725..264.728 rows=1 loops=1)

33. 263.431 263.431 ↑ 236.0 1 1

CTE Scan on slrstaffpostemp t (cost=0.00..4.72 rows=236 width=1,532) (actual time=263.430..263.431 rows=1 loops=1)

34. 0.320 1.287 ↑ 1.0 1 1

Index Scan using fk_slrstaffposlist_staffpos on slrstaffposlist sl (cost=0.42..21.65 rows=1 width=76) (actual time=1.285..1.287 rows=1 loops=1)

  • Index Cond: (t.id = idstaffpos)
  • Filter: ($9 AND (alternatives: SubPlan 10 or hashed SubPlan 13) AND (COALESCE(t.dend, cmn.todate('31.01.2020 00:00:00'::character varying)) >= dbegin) AND (COALESCE(t.dend, cmn.todate('31.01.2020 00:00:00'::character varying)) <= COALESCE(dend, cmn.todate('31.01.2020 00:00:00'::character varying))))
35.          

SubPlan (for Index Scan)

36. 0.514 0.967 ↑ 1.0 1 1

Index Scan using pk_slrstaffpos on slrstaffpos (cost=6.20..8.42 rows=1 width=0) (actual time=0.967..0.967 rows=1 loops=1)

  • Index Cond: (id = sl.idstaffpos)
  • Filter: ($12 AND ((NOT (hashed SubPlan 8)) OR (iddepartment IS NULL)))
37.          

Initplan (for Index Scan)

38. 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)

39.          

SubPlan (for Index Scan)

40. 0.321 0.322 ↓ 19.1 1,907 1

ProjectSet (cost=0.00..3.02 rows=100 width=32) (actual time=0.161..0.322 rows=1,907 loops=1)

41. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1)

42. 0.000 0.000 ↓ 0.0 0

Seq Scan on slrstaffpos slrstaffpos_1 (cost=5.78..5,830.57 rows=32,316 width=8) (never executed)

  • Filter: ($15 AND ((NOT (hashed SubPlan 11)) OR (iddepartment IS NULL)))
43.          

Initplan (for Seq Scan)

44. 0.000 0.000 ↓ 0.0 0

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

45.          

SubPlan (for Seq Scan)

46. 0.000 0.000 ↓ 0.0 0

ProjectSet (cost=0.00..3.02 rows=100 width=32) (never executed)

47. 0.000 0.000 ↓ 0.0 0

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

48. 0.059 5.752 ↓ 41.2 165 1

Materialize (cost=0.15..351.66 rows=4 width=34) (actual time=1.022..5.752 rows=165 loops=1)

49. 0.049 5.693 ↓ 41.2 165 1

Nested Loop (cost=0.15..351.64 rows=4 width=34) (actual time=1.019..5.693 rows=165 loops=1)

50. 0.666 1.261 ↓ 9.0 9 1

Seq Scan on slrscalewageshist (cost=0.00..139.47 rows=1 width=36) (actual time=0.559..1.261 rows=9 loops=1)

  • Filter: ($47 AND (alternatives: SubPlan 47 or hashed SubPlan 49) AND (cmn.todate('31.01.2020 00:00:00'::character varying) >= dperiodbegin) AND (cmn.todate('31.01.2020 00:00:00'::character varying) <= COALESCE(dperiodend, cmn.todate('31.01.2020 00:00:00'::character varying))))
  • Rows Removed by Filter: 8
51.          

SubPlan (for Seq Scan)

52. 0.478 0.595 ↑ 1.0 1 17

Index Scan using pk_slrscalewages on slrscalewages slrscalewages_4 (cost=2.65..7.38 rows=1 width=0) (actual time=0.035..0.035 rows=1 loops=17)

  • Index Cond: (id = slrscalewageshist.idscalewages)
  • Filter: ($49 AND ((idgroupwages <> ALL (adm_pfuncafi.gettblaccessforattr_notin(SESSION_USER, 'slrscalewages'::name, '1402001'::numeric))) OR (idgroupwages IS NULL)))
53.          

Initplan (for Index Scan)

54. 0.117 0.117 ↑ 1.0 1 1

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

55. 0.000 0.000 ↓ 0.0 0

Seq Scan on slrscalewages slrscalewages_5 (cost=2.51..26.24 rows=4 width=18) (never executed)

  • Filter: ($51 AND ((idgroupwages <> ALL (adm_pfuncafi.gettblaccessforattr_notin(SESSION_USER, 'slrscalewages'::name, '1402001'::numeric))) OR (idgroupwages IS NULL)))
56.          

Initplan (for Seq Scan)

57. 0.000 0.000 ↓ 0.0 0

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

58. 0.258 4.383 ↓ 4.5 18 9

Index Scan using fk_slrscalewageslist_sclwshist on slrscalewageslist (cost=0.15..212.14 rows=4 width=22) (actual time=0.077..0.487 rows=18 loops=9)

  • Index Cond: (idscalewageshist = slrscalewageshist.id)
  • Filter: ($34 AND (alternatives: SubPlan 38 or hashed SubPlan 44))
59.          

SubPlan (for Index Scan)

60. 0.371 4.125 ↑ 1.0 1 165

Index Scan using pk_slrscalewageshist on slrscalewageshist slrscalewageshist_1 (cost=2.65..12.25 rows=1 width=0) (actual time=0.025..0.025 rows=1 loops=165)

  • Index Cond: (id = slrscalewageslist.idscalewageshist)
  • Filter: ($36 AND (alternatives: SubPlan 35 or hashed SubPlan 37))
61.          

Initplan (for Index Scan)

62. 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)

63.          

SubPlan (for Index Scan)

64. 3.630 3.630 ↑ 1.0 1 165

Index Scan using pk_slrscalewages on slrscalewages (cost=2.65..7.38 rows=1 width=0) (actual time=0.022..0.022 rows=1 loops=165)