explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dLaL

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 9,801.673 ↑ 236.0 1 1

Sort (cost=14,732.47..14,733.06 rows=236 width=50) (actual time=9,801.672..9,801.673 rows=1 loops=1)

  • Sort Key: t.slevel
  • Sort Method: quicksort Memory: 25kB
2.          

CTE slrdepartmentrecurs

3. 11.921 2,666.766 ↓ 77.1 13,176 1

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

4. 0.446 0.733 ↑ 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.703..0.733 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.287 0.287 ↑ 1.0 1 1

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

7. 15.303 2,654.112 ↓ 96.9 1,647 8

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

8.          

Initplan (for Nested Loop)

9. 0.185 0.185 ↑ 1.0 1 1

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

10. 3.424 3.424 ↓ 164.7 1,647 8

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

11. 2,635.200 2,635.200 ↑ 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.048..0.200 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. 17.237 9,790.273 ↑ 236.0 1 1

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

14.          

Initplan (for Nested Loop)

15. 0.208 0.208 ↑ 1.0 1 1

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

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

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

17. 7,088.351 7,088.688 ↓ 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.538..0.538 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.336 0.337 ↓ 19.1 1,907 1

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

20. 0.001 0.001 ↑ 1.0 1 1

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

21.          

Initplan (for Sort)

22. 0.228 0.228 ↑ 1.0 1 1

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

23. 0.160 0.160 ↑ 1.0 1 1

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

24. 0.132 0.132 ↑ 1.0 1 1

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

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

26. 0.184 0.184 ↑ 1.0 1 1

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

27. 4.289 9,801.644 ↑ 236.0 1 1

Nested Loop Left Join (cost=1.24..6,924.74 rows=236 width=50) (actual time=267.014..9,801.644 rows=1 loops=1)

  • Join Filter: ((sl.idtarifnet = slrtariflist.idtarifnet) AND (sl.nrank = slrtarif.nrank))
  • Rows Removed by Join Filter: 267
28. 0.051 9,797.355 ↑ 236.0 1 1

Nested Loop Left Join (cost=0.57..5,485.55 rows=236 width=61) (actual time=262.725..9,797.355 rows=1 loops=1)

  • Join Filter: ((sl.idscalewages = slrscalewageshist.idscalewages) AND (sl.nranksw = slrscalewageslist.nranksw))
  • Rows Removed by Join Filter: 164
29. 0.010 9,791.577 ↑ 236.0 1 1

Nested Loop Left Join (cost=0.42..5,117.38 rows=236 width=71) (actual time=258.992..9,791.577 rows=1 loops=1)

30. 9,790.280 9,790.280 ↑ 236.0 1 1

CTE Scan on slrstaffpostemp t (cost=0.00..4.72 rows=236 width=58) (actual time=257.698..9,790.280 rows=1 loops=1)

31. 0.310 1.287 ↑ 1.0 1 1

Index Scan using fk_slrstaffposlist_staffpos on slrstaffposlist sl (cost=0.42..21.65 rows=1 width=45) (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))))
32.          

SubPlan (for Index Scan)

33. 0.511 0.977 ↑ 1.0 1 1

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

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

Initplan (for Index Scan)

35. 0.128 0.128 ↑ 1.0 1 1

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

36.          

SubPlan (for Index Scan)

37. 0.337 0.338 ↓ 19.1 1,907 1

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

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

39. 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)))
40.          

Initplan (for Seq Scan)

41. 0.000 0.000 ↓ 0.0 0

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

42.          

SubPlan (for Seq Scan)

43. 0.000 0.000 ↓ 0.0 0

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

44. 0.000 0.000 ↓ 0.0 0

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

45. 0.039 5.727 ↓ 41.2 165 1

Materialize (cost=0.15..351.66 rows=4 width=22) (actual time=1.055..5.727 rows=165 loops=1)

46. 0.041 5.688 ↓ 41.2 165 1

Nested Loop (cost=0.15..351.64 rows=4 width=22) (actual time=1.053..5.688 rows=165 loops=1)

47. 0.615 1.210 ↓ 9.0 9 1

Seq Scan on slrscalewageshist (cost=0.00..139.47 rows=1 width=36) (actual time=0.599..1.210 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
48.          

SubPlan (for Seq Scan)

49. 0.476 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)))
50.          

Initplan (for Index Scan)

51. 0.119 0.119 ↑ 1.0 1 1

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

52. 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)))
53.          

Initplan (for Seq Scan)

54. 0.000 0.000 ↓ 0.0 0

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

55. 0.312 4.437 ↓ 4.5 18 9

Index Scan using fk_slrscalewageslist_sclwshist on slrscalewageslist (cost=0.15..212.14 rows=4 width=10) (actual time=0.075..0.493 rows=18 loops=9)

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

SubPlan (for Index Scan)

57. 0.377 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))
58.          

Initplan (for Index Scan)

59. 0.118 0.118 ↑ 1.0 1 1

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

60.          

SubPlan (for Index Scan)

61. 3.531 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)

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

Initplan (for Index Scan)

63. 0.099 0.099 ↑ 1.0 1 1

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