explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iL2P

Settings
# exclusive inclusive rows x rows loops node
1. 0.243 9,689.197 ↑ 1.0 1 1

Aggregate (cost=42,712.87..42,712.88 rows=1 width=12) (actual time=9,689.196..9,689.197 rows=1 loops=1)

2. 138.662 9,688.954 ↓ 300.0 300 1

GroupAggregate (cost=42,661.41..42,712.85 rows=1 width=12) (actual time=8,872.681..9,688.954 rows=300 loops=1)

  • Group Key: dr.cddocument, dr.cdrevision
3. 44.603 8,884.636 ↓ 18,508.0 18,508 1

Sort (cost=42,661.41..42,661.41 rows=1 width=32) (actual time=8,867.941..8,884.636 rows=18,508 loops=1)

  • Sort Key: dr.cddocument, dr.cdrevision
  • Sort Method: external merge Disk: 768kB
4. 58.620 8,840.033 ↓ 18,508.0 18,508 1

Nested Loop Anti Join (cost=801.16..42,661.40 rows=1 width=32) (actual time=152.679..8,840.033 rows=18,508 loops=1)

  • Join Filter: (du1.cdrevision >= (max(dr1.cdrevision)))
  • Rows Removed by Join Filter: 7384
5. 51.954 8,189.093 ↓ 18,510.0 18,510 1

Nested Loop (cost=800.73..42,655.96 rows=1 width=40) (actual time=152.643..8,189.093 rows=18,510 loops=1)

6. 49.426 8,081.609 ↓ 18,510.0 18,510 1

Nested Loop (cost=800.45..42,655.66 rows=1 width=40) (actual time=152.623..8,081.609 rows=18,510 loops=1)

  • Join Filter: (dr.cdrevision = rv.cdrevision)
7. 64.662 7,976.653 ↓ 18,510.0 18,510 1

Nested Loop (cost=800.17..42,655.33 rows=1 width=40) (actual time=152.602..7,976.653 rows=18,510 loops=1)

  • Join Filter: (dr.cddocument = dc.cddocument)
8. 35.447 734.367 ↓ 21,883.0 21,883 1

Nested Loop (cost=799.89..42,588.24 rows=1 width=40) (actual time=150.609..734.367 rows=21,883 loops=1)

9. 4.711 392.141 ↓ 1,837.0 1,837 1

Nested Loop (cost=799.46..42,579.78 rows=1 width=24) (actual time=149.821..392.141 rows=1,837 loops=1)

10. 6.090 381.919 ↓ 229.6 1,837 1

Nested Loop (cost=799.32..42,575.22 rows=8 width=20) (actual time=149.802..381.919 rows=1,837 loops=1)

11. 14.175 151.715 ↓ 2.1 1,837 1

HashAggregate (cost=799.03..807.98 rows=895 width=8) (actual time=149.518..151.715 rows=1,837 loops=1)

  • Group Key: dr1.cddocument
  • Filter: (max(dr1.cdrevision) IS NOT NULL)
12. 41.205 137.540 ↓ 4.5 4,021 1

Hash Join (cost=389.27..792.32 rows=895 width=8) (actual time=69.148..137.540 rows=4,021 loops=1)

  • Hash Cond: (gr1.cdrevision = dr1.cdrevision)
  • Join Filter: (((dccat.fgenablerevision = 1) AND (dccat.fgrectrainafter = 2) AND (gr1.fgstatus = 5)) OR ((dccat.fgenablerevision = 1) AND (dccat.fgrectrainafter = 1) AND (gr1.fgstatus = ANY ('{4,5}'::integer[]))) OR (gr1.fgstatus = 6))
  • Rows Removed by Join Filter: 165
13. 28.434 28.434 ↑ 1.0 12,093 1

Seq Scan on gnrevision gr1 (cost=0.00..331.93 rows=12,093 width=8) (actual time=0.020..28.434 rows=12,093 loops=1)

14. 13.099 67.901 ↓ 4.5 4,186 1

Hash (cost=377.56..377.56 rows=937 width=16) (actual time=67.901..67.901 rows=4,186 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 261kB
15. 30.751 54.802 ↓ 4.5 4,186 1

Hash Join (cost=5.68..377.56 rows=937 width=16) (actual time=0.858..54.802 rows=4,186 loops=1)

  • Hash Cond: (dr1.cdcategory = dccat.cdcategory)
16. 23.849 23.849 ↑ 1.0 6,558 1

Index Scan using seix_docreivisiofgtrainr on dcdocrevision dr1 (cost=0.29..354.20 rows=6,558 width=12) (actual time=0.035..23.849 rows=6,558 loops=1)

  • Index Cond: (fgtrainrequired = 1)
17. 0.055 0.202 ↑ 1.0 14 1

Hash (cost=5.22..5.22 rows=14 width=12) (actual time=0.201..0.202 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.147 0.147 ↑ 1.0 14 1

Seq Scan on dccategory dccat (cost=0.00..5.22 rows=14 width=12) (actual time=0.016..0.147 rows=14 loops=1)

  • Filter: (fgenabledtraining = 1)
  • Rows Removed by Filter: 84
19. 19.931 224.114 ↑ 1.0 1 1,837

Index Scan using seixdocrecddocumen on dcdocrevision dr (cost=0.29..46.65 rows=1 width=12) (actual time=0.114..0.122 rows=1 loops=1,837)

  • Index Cond: (cddocument = dr1.cddocument)
  • Filter: (cdrevision = (SubPlan 9))
  • Rows Removed by Filter: 1
20.          

SubPlan (forIndex Scan)

21. 12.501 204.183 ↑ 1.0 1 4,167

Aggregate (cost=22.43..22.44 rows=1 width=4) (actual time=0.049..0.049 rows=1 loops=4,167)

22. 62.646 191.682 ↑ 1.0 1 4,167

Nested Loop (cost=5.97..22.43 rows=1 width=4) (actual time=0.040..0.046 rows=1 loops=4,167)

  • Join Filter: (((ct1.fgenablerevision = 1) AND (ct1.fgrectrainafter = 2) AND (rv1.fgstatus = 5)) OR ((ct1.fgenablerevision = 1) AND (ct1.fgrectrainafter = 1) AND (rv1.fgstatus = ANY ('{4,5}'::integer[]))) OR ((rv1.fgstatus = 6) AND (dr1_1.fgcurrent = 1)))
  • Rows Removed by Join Filter: 4
23. 41.503 70.839 ↓ 5.0 5 4,167

Hash Join (cost=5.68..14.10 rows=1 width=16) (actual time=0.005..0.017 rows=5 loops=4,167)

  • Hash Cond: (dr1_1.cdcategory = ct1.cdcategory)
24. 29.169 29.169 ↓ 2.5 5 4,167

Index Scan using seixdocrecddocumen on dcdocrevision dr1_1 (cost=0.29..8.69 rows=2 width=12) (actual time=0.002..0.007 rows=5 loops=4,167)

  • Index Cond: (cddocument = dr.cddocument)
25. 0.045 0.167 ↑ 1.0 14 1

Hash (cost=5.22..5.22 rows=14 width=12) (actual time=0.166..0.167 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 0.122 0.122 ↑ 1.0 14 1

Seq Scan on dccategory ct1 (cost=0.00..5.22 rows=14 width=12) (actual time=0.014..0.122 rows=14 loops=1)

  • Filter: (fgenabledtraining = 1)
  • Rows Removed by Filter: 84
27. 58.197 58.197 ↑ 1.0 1 19,399

Index Scan using pkgnrevision on gnrevision rv1 (cost=0.29..8.30 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=19,399)

  • Index Cond: (cdrevision = dr1_1.cdrevision)
28. 5.511 5.511 ↑ 1.0 1 1,837

Index Scan using pkdccategory on dccategory ct (cost=0.14..0.56 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=1,837)

  • Index Cond: (cdcategory = dr.cdcategory)
  • Filter: (fgenabledtraining = 1)
29. 306.779 306.779 ↓ 12.0 12 1,837

Index Scan using dcdocumentuser_pk on dcdocumentuser du (cost=0.43..8.45 rows=1 width=16) (actual time=0.129..0.167 rows=12 loops=1,837)

  • Index Cond: ((cddocument = dr.cddocument) AND (cdrevision = dr.cdrevision))
  • Filter: ((dttraining IS NULL) AND (cdtrain IS NULL) AND (fgtraining = 1) AND (fgenabled = 1))
  • Rows Removed by Filter: 178
30. 114.906 7,177.624 ↑ 1.0 1 21,883

Index Scan using pkdcdocument on dcdocument dc (cost=0.28..67.08 rows=1 width=4) (actual time=0.328..0.328 rows=1 loops=21,883)

  • Index Cond: (cddocument = du.cddocument)
  • Filter: ((fgstatus <> ALL ('{4,5}'::integer[])) AND (NOT (SubPlan 8)) AND (SubPlan 7))
  • Rows Removed by Filter: 0
31.          

SubPlan (forIndex Scan)

32. 37.468 6,819.176 ↓ 0.0 0 18,734

Append (cost=0.43..197.67 rows=6 width=4) (actual time=0.364..0.364 rows=0 loops=18,734)

33. 37.468 3,390.854 ↓ 0.0 0 18,734

Result (cost=0.43..98.84 rows=3 width=4) (actual time=0.181..0.181 rows=0 loops=18,734)

34. 56.202 3,353.386 ↓ 0.0 0 18,734

Append (cost=0.43..98.81 rows=3 width=0) (actual time=0.179..0.179 rows=0 loops=18,734)

35. 56.202 56.202 ↓ 0.0 0 18,734

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc dcuserpermissiondoc_2 (cost=0.43..8.21 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=18,734)

  • Index Cond: ((cdpermission = 10) AND (cduser = 639) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
36. 37.468 3,072.376 ↓ 0.0 0 18,734

Subquery Scan on *SELECT* 2_2 (cost=8.91..27.66 rows=1 width=0) (actual time=0.164..0.164 rows=0 loops=18,734)

37. 56.202 3,034.908 ↓ 0.0 0 18,734

Nested Loop (cost=8.91..27.65 rows=1 width=20) (actual time=0.162..0.162 rows=0 loops=18,734)

38. 18.734 2,978.706 ↓ 0.0 0 18,734

Nested Loop (cost=8.62..19.34 rows=1 width=4) (actual time=0.159..0.159 rows=0 loops=18,734)

  • Join Filter: (pc_2.cdcategory = dr_5.cdcategory)
39. 1,517.437 2,959.972 ↓ 0.0 0 18,734

Hash Join (cost=8.34..13.59 rows=1 width=8) (actual time=0.158..0.158 rows=0 loops=18,734)

  • Hash Cond: (c_4.cdcategory = pc_2.cdcategory)
40. 1,442.518 1,442.518 ↑ 1.0 98 18,734

Seq Scan on dccategory c_4 (cost=0.00..4.98 rows=98 width=4) (actual time=0.002..0.077 rows=98 loops=18,734)

41. 0.004 0.017 ↓ 0.0 0 1

Hash (cost=8.33..8.33 rows=1 width=4) (actual time=0.016..0.017 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
42. 0.013 0.013 ↓ 0.0 0 1

Index Only Scan using dcuserpermissioncateg_pk on dcuserpermissioncateg pc_2 (cost=0.29..8.33 rows=1 width=4) (actual time=0.012..0.013 rows=0 loops=1)

  • Index Cond: ((cdpermission = 10) AND (cduser = 639) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
43. 0.000 0.000 ↓ 0.0 0

Index Only Scan using seixfgcurrentinclude2 on dcdocrevision dr_5 (cost=0.29..5.74 rows=1 width=8) (never executed)

  • Index Cond: ((fgcurrent = 1) AND (cdcategory = c_4.cdcategory) AND (cddocument = dc.cddocument))
  • Heap Fetches: 0
44. 0.000 0.000 ↓ 0.0 0

Index Scan using pkdcdocument on dcdocument dc_3 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: (cddocument = dc.cddocument)
  • Filter: (fgusecataccessrole = 1)
45. 18.734 168.606 ↓ 0.0 0 18,734

Subquery Scan on *SELECT* 3_2 (cost=9.03..62.94 rows=1 width=0) (actual time=0.009..0.009 rows=0 loops=18,734)

46. 37.468 149.872 ↓ 0.0 0 18,734

Group (cost=9.03..62.93 rows=1 width=20) (actual time=0.008..0.008 rows=0 loops=18,734)

  • Group Key: sru_2.cdpermission, src_2.cddocument, sru_2.cduser, sru_2.fgpermissiontype
47. 18.734 112.404 ↓ 0.0 0 18,734

Nested Loop (cost=9.03..62.92 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=18,734)

48. 37.468 93.670 ↓ 0.0 0 18,734

Nested Loop (cost=8.75..54.61 rows=1 width=20) (actual time=0.005..0.005 rows=0 loops=18,734)

49. 18.734 56.202 ↓ 0.0 0 18,734

Nested Loop (cost=0.31..40.80 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=18,734)

50. 37.468 37.468 ↓ 0.0 0 18,734

Index Only Scan using dcsecruleconduser_pkey on dcsecruleconduser sru_2 (cost=0.15..31.29 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=18,734)

  • Index Cond: ((cduser = 639) AND (cdpermission = 10) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
51. 0.000 0.000 ↓ 0.0 0

Index Only Scan using dcsecruleconddoc_pkey on dcsecruleconddoc src_2 (cost=0.15..8.17 rows=1 width=8) (never executed)

  • Index Cond: ((cdcondition = sru_2.cdcondition) AND (cddocument = dc.cddocument))
  • Heap Fetches: 0
52. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.44..13.80 rows=1 width=4) (never executed)

  • Hash Cond: (c_5.cdcategory = dr_6.cdcategory)
53. 0.000 0.000 ↓ 0.0 0

Seq Scan on dccategory c_5 (cost=0.00..4.98 rows=98 width=4) (never executed)

54. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.43..8.43 rows=1 width=8) (never executed)

55. 0.000 0.000 ↓ 0.0 0

Index Only Scan using seixfgcurrentinclude on dcdocrevision dr_6 (cost=0.41..8.43 rows=1 width=8) (never executed)

  • Index Cond: ((fgcurrent = 1) AND (cddocument = dc.cddocument))
  • Heap Fetches: 0
56. 0.000 0.000 ↓ 0.0 0

Index Scan using pkdcdocument on dcdocument dd_2 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: (cddocument = dc.cddocument)
  • Filter: (fgusecataccessrole = 1)
57. 37.468 3,390.854 ↓ 0.0 0 18,734

Result (cost=0.43..98.77 rows=3 width=4) (actual time=0.181..0.181 rows=0 loops=18,734)

58. 74.936 3,353.386 ↓ 0.0 0 18,734

Append (cost=0.43..98.74 rows=3 width=0) (actual time=0.179..0.179 rows=0 loops=18,734)

59. 56.202 56.202 ↓ 0.0 0 18,734

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc dcuserpermissiondoc_3 (cost=0.43..8.21 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=18,734)

  • Index Cond: ((cdpermission = 10) AND (cduser = '-1'::integer) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
60. 18.734 3,053.642 ↓ 0.0 0 18,734

Subquery Scan on *SELECT* 2_3 (cost=8.83..27.58 rows=1 width=0) (actual time=0.163..0.163 rows=0 loops=18,734)

61. 56.202 3,034.908 ↓ 0.0 0 18,734

Nested Loop (cost=8.83..27.57 rows=1 width=20) (actual time=0.162..0.162 rows=0 loops=18,734)

62. 18.734 2,978.706 ↓ 0.0 0 18,734

Nested Loop (cost=8.55..19.26 rows=1 width=4) (actual time=0.159..0.159 rows=0 loops=18,734)

  • Join Filter: (pc_3.cdcategory = dr_7.cdcategory)
63. 1,498.706 2,959.972 ↓ 0.0 0 18,734

Hash Join (cost=8.26..13.51 rows=1 width=8) (actual time=0.158..0.158 rows=0 loops=18,734)

  • Hash Cond: (c_6.cdcategory = pc_3.cdcategory)
64. 1,461.252 1,461.252 ↑ 1.0 98 18,734

Seq Scan on dccategory c_6 (cost=0.00..4.98 rows=98 width=4) (actual time=0.002..0.078 rows=98 loops=18,734)

65. 0.004 0.014 ↓ 0.0 0 1

Hash (cost=8.25..8.25 rows=1 width=4) (actual time=0.013..0.014 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
66. 0.010 0.010 ↓ 0.0 0 1

Index Only Scan using dcuserpermissioncateg_pk on dcuserpermissioncateg pc_3 (cost=0.29..8.25 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: ((cdpermission = 10) AND (cduser = '-1'::integer) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
67. 0.000 0.000 ↓ 0.0 0

Index Only Scan using seixfgcurrentinclude2 on dcdocrevision dr_7 (cost=0.29..5.74 rows=1 width=8) (never executed)

  • Index Cond: ((fgcurrent = 1) AND (cdcategory = c_6.cdcategory) AND (cddocument = dc.cddocument))
  • Heap Fetches: 0
68. 0.000 0.000 ↓ 0.0 0

Index Scan using pkdcdocument on dcdocument dc_4 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: (cddocument = dc.cddocument)
  • Filter: (fgusecataccessrole = 1)
69. 18.734 168.606 ↓ 0.0 0 18,734

Subquery Scan on *SELECT* 3_3 (cost=9.03..62.94 rows=1 width=0) (actual time=0.009..0.009 rows=0 loops=18,734)

70. 37.468 149.872 ↓ 0.0 0 18,734

Group (cost=9.03..62.93 rows=1 width=20) (actual time=0.008..0.008 rows=0 loops=18,734)

  • Group Key: sru_3.cdpermission, src_3.cddocument, sru_3.cduser, sru_3.fgpermissiontype
71. 18.734 112.404 ↓ 0.0 0 18,734

Nested Loop (cost=9.03..62.92 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=18,734)

72. 37.468 93.670 ↓ 0.0 0 18,734

Nested Loop (cost=8.75..54.61 rows=1 width=20) (actual time=0.005..0.005 rows=0 loops=18,734)

73. 37.468 56.202 ↓ 0.0 0 18,734

Nested Loop (cost=0.31..40.80 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=18,734)

74. 18.734 18.734 ↓ 0.0 0 18,734

Index Only Scan using dcsecruleconduser_pkey on dcsecruleconduser sru_3 (cost=0.15..31.29 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=18,734)

  • Index Cond: ((cduser = '-1'::integer) AND (cdpermission = 10) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
75. 0.000 0.000 ↓ 0.0 0

Index Only Scan using dcsecruleconddoc_pkey on dcsecruleconddoc src_3 (cost=0.15..8.17 rows=1 width=8) (never executed)

  • Index Cond: ((cdcondition = sru_3.cdcondition) AND (cddocument = dc.cddocument))
  • Heap Fetches: 0
76. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.44..13.80 rows=1 width=4) (never executed)

  • Hash Cond: (c_7.cdcategory = dr_8.cdcategory)
77. 0.000 0.000 ↓ 0.0 0

Seq Scan on dccategory c_7 (cost=0.00..4.98 rows=98 width=4) (never executed)

78. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.43..8.43 rows=1 width=8) (never executed)

79. 0.000 0.000 ↓ 0.0 0

Index Only Scan using seixfgcurrentinclude on dcdocrevision dr_8 (cost=0.41..8.43 rows=1 width=8) (never executed)

  • Index Cond: ((fgcurrent = 1) AND (cddocument = dc.cddocument))
  • Heap Fetches: 0
80. 0.000 0.000 ↓ 0.0 0

Index Scan using pkdcdocument on dcdocument dd_3 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: (cddocument = dc.cddocument)
  • Filter: (fgusecataccessrole = 1)
81. 13.418 243.542 ↑ 6.0 1 18,734

Append (cost=0.43..198.67 rows=6 width=4) (actual time=0.013..0.013 rows=1 loops=18,734)

82. 37.468 187.340 ↑ 3.0 1 18,734

Result (cost=0.43..99.30 rows=3 width=4) (actual time=0.010..0.010 rows=1 loops=18,734)

83. 32.376 149.872 ↑ 3.0 1 18,734

Append (cost=0.43..99.27 rows=3 width=0) (actual time=0.008..0.008 rows=1 loops=18,734)

84. 74.936 74.936 ↑ 1.0 1 18,734

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc (cost=0.43..8.46 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=18,734)

  • Index Cond: ((cdpermission = 10) AND (cduser = 639) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 1))
  • Heap Fetches: 18510
85. 0.224 40.544 ↓ 0.0 0 224

Subquery Scan on *SELECT* 2 (cost=9.01..27.88 rows=1 width=0) (actual time=0.181..0.181 rows=0 loops=224)

86. 0.658 40.320 ↓ 0.0 0 224

Nested Loop (cost=9.01..27.87 rows=1 width=20) (actual time=0.180..0.180 rows=0 loops=224)

87. 1.344 39.200 ↑ 1.0 1 224

Nested Loop (cost=8.73..19.55 rows=1 width=4) (actual time=0.135..0.175 rows=1 loops=224)

  • Join Filter: (dr_1.cdcategory = pc.cdcategory)
88. 18.592 37.184 ↑ 1.0 1 224

Hash Join (cost=8.44..13.80 rows=1 width=12) (actual time=0.092..0.166 rows=1 loops=224)

  • Hash Cond: (c.cdcategory = dr_1.cdcategory)
89. 16.576 16.576 ↑ 1.0 98 224

Seq Scan on dccategory c (cost=0.00..4.98 rows=98 width=4) (actual time=0.002..0.074 rows=98 loops=224)

90. 0.896 2.016 ↑ 1.0 1 224

Hash (cost=8.43..8.43 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=224)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
91. 1.120 1.120 ↑ 1.0 1 224

Index Only Scan using seixfgcurrentinclude on dcdocrevision dr_1 (cost=0.41..8.43 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=224)

  • Index Cond: ((fgcurrent = 1) AND (cddocument = dc.cddocument))
  • Heap Fetches: 224
92. 0.672 0.672 ↑ 1.0 1 224

Index Only Scan using dcuserpermissioncateg_pk on dcuserpermissioncateg pc (cost=0.29..5.74 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=224)

  • Index Cond: ((cdpermission = 10) AND (cduser = 639) AND (cdcategory = c.cdcategory) AND (fgpermissiontype = 1))
  • Heap Fetches: 154
93. 0.462 0.462 ↓ 0.0 0 154

Index Scan using pkdcdocument on dcdocument dc_1 (cost=0.28..8.30 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=154)

  • Index Cond: (cddocument = dc.cddocument)
  • Filter: (fgusecataccessrole = 1)
  • Rows Removed by Filter: 1
94. 0.448 2.016 ↓ 0.0 0 224

Subquery Scan on *SELECT* 3 (cost=9.03..62.94 rows=1 width=0) (actual time=0.009..0.009 rows=0 loops=224)

95. 0.224 1.568 ↓ 0.0 0 224

Group (cost=9.03..62.93 rows=1 width=20) (actual time=0.007..0.007 rows=0 loops=224)

  • Group Key: sru.cdpermission, src.cddocument, sru.cduser, sru.fgpermissiontype
96. 0.448 1.344 ↓ 0.0 0 224

Nested Loop (cost=9.03..62.92 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=224)

97. 0.224 0.896 ↓ 0.0 0 224

Nested Loop (cost=8.75..54.61 rows=1 width=20) (actual time=0.004..0.004 rows=0 loops=224)

98. 0.448 0.672 ↓ 0.0 0 224

Nested Loop (cost=8.59..45.10 rows=1 width=20) (actual time=0.003..0.003 rows=0 loops=224)

99. 0.224 0.224 ↓ 0.0 0 224

Index Only Scan using dcsecruleconduser_pkey on dcsecruleconduser sru (cost=0.15..31.29 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=224)

  • Index Cond: ((cduser = 639) AND (cdpermission = 10) AND (fgpermissiontype = 1))
  • Heap Fetches: 0
100. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.44..13.80 rows=1 width=4) (never executed)

  • Hash Cond: (c_1.cdcategory = dr_2.cdcategory)
101. 0.000 0.000 ↓ 0.0 0

Seq Scan on dccategory c_1 (cost=0.00..4.98 rows=98 width=4) (never executed)

102. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.43..8.43 rows=1 width=8) (never executed)

103. 0.000 0.000 ↓ 0.0 0

Index Only Scan using seixfgcurrentinclude on dcdocrevision dr_2 (cost=0.41..8.43 rows=1 width=8) (never executed)

  • Index Cond: ((fgcurrent = 1) AND (cddocument = dc.cddocument))
  • Heap Fetches: 0
104. 0.000 0.000 ↓ 0.0 0

Index Only Scan using dcsecruleconddoc_pkey on dcsecruleconddoc src (cost=0.15..8.17 rows=1 width=8) (never executed)

  • Index Cond: ((cdcondition = sru.cdcondition) AND (cddocument = dc.cddocument))
  • Heap Fetches: 0
105. 0.000 0.000 ↓ 0.0 0

Index Scan using pkdcdocument on dcdocument dd (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: (cddocument = dc.cddocument)
  • Filter: (fgusecataccessrole = 1)
106. 0.448 42.784 ↓ 0.0 0 224

Result (cost=0.43..99.30 rows=3 width=4) (actual time=0.191..0.191 rows=0 loops=224)

107. 0.672 42.336 ↓ 0.0 0 224

Append (cost=0.43..99.27 rows=3 width=0) (actual time=0.189..0.189 rows=0 loops=224)

108. 0.672 0.672 ↓ 0.0 0 224

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc dcuserpermissiondoc_1 (cost=0.43..8.46 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=224)

  • Index Cond: ((cdpermission = 10) AND (cduser = '-1'::integer) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 1))
  • Heap Fetches: 0
109. 0.448 38.976 ↓ 0.0 0 224

Subquery Scan on *SELECT* 2_1 (cost=9.01..27.88 rows=1 width=0) (actual time=0.174..0.174 rows=0 loops=224)

110. 0.224 38.528 ↓ 0.0 0 224

Nested Loop (cost=9.01..27.87 rows=1 width=20) (actual time=0.172..0.172 rows=0 loops=224)

111. 1.344 38.304 ↓ 0.0 0 224

Nested Loop (cost=8.73..19.55 rows=1 width=4) (actual time=0.171..0.171 rows=0 loops=224)

  • Join Filter: (dr_3.cdcategory = pc_1.cdcategory)
112. 18.144 36.512 ↑ 1.0 1 224

Hash Join (cost=8.44..13.80 rows=1 width=12) (actual time=0.090..0.163 rows=1 loops=224)

  • Hash Cond: (c_2.cdcategory = dr_3.cdcategory)
113. 16.800 16.800 ↑ 1.0 98 224

Seq Scan on dccategory c_2 (cost=0.00..4.98 rows=98 width=4) (actual time=0.002..0.075 rows=98 loops=224)

114. 0.672 1.568 ↑ 1.0 1 224

Hash (cost=8.43..8.43 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=224)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
115. 0.896 0.896 ↑ 1.0 1 224

Index Only Scan using seixfgcurrentinclude on dcdocrevision dr_3 (cost=0.41..8.43 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=224)

  • Index Cond: ((fgcurrent = 1) AND (cddocument = dc.cddocument))
  • Heap Fetches: 224
116. 0.448 0.448 ↓ 0.0 0 224

Index Only Scan using dcuserpermissioncateg_pk on dcuserpermissioncateg pc_1 (cost=0.29..5.74 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=224)

  • Index Cond: ((cdpermission = 10) AND (cduser = '-1'::integer) AND (cdcategory = c_2.cdcategory) AND (fgpermissiontype = 1))
  • Heap Fetches: 0
117. 0.000 0.000 ↓ 0.0 0

Index Scan using pkdcdocument on dcdocument dc_2 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: (cddocument = dc.cddocument)
  • Filter: (fgusecataccessrole = 1)
118. 0.448 2.016 ↓ 0.0 0 224

Subquery Scan on *SELECT* 3_1 (cost=9.03..62.94 rows=1 width=0) (actual time=0.009..0.009 rows=0 loops=224)

119. 0.224 1.568 ↓ 0.0 0 224

Group (cost=9.03..62.93 rows=1 width=20) (actual time=0.007..0.007 rows=0 loops=224)

  • Group Key: sru_1.cdpermission, src_1.cddocument, sru_1.cduser, sru_1.fgpermissiontype
120. 0.448 1.344 ↓ 0.0 0 224

Nested Loop (cost=9.03..62.92 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=224)

121. 0.224 0.896 ↓ 0.0 0 224

Nested Loop (cost=8.75..54.61 rows=1 width=20) (actual time=0.004..0.004 rows=0 loops=224)

122. 0.448 0.672 ↓ 0.0 0 224

Nested Loop (cost=8.59..45.10 rows=1 width=20) (actual time=0.003..0.003 rows=0 loops=224)

123. 0.224 0.224 ↓ 0.0 0 224

Index Only Scan using dcsecruleconduser_pkey on dcsecruleconduser sru_1 (cost=0.15..31.29 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=224)

  • Index Cond: ((cduser = '-1'::integer) AND (cdpermission = 10) AND (fgpermissiontype = 1))
  • Heap Fetches: 0
124. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.44..13.80 rows=1 width=4) (never executed)

  • Hash Cond: (c_3.cdcategory = dr_4.cdcategory)
125. 0.000 0.000 ↓ 0.0 0

Seq Scan on dccategory c_3 (cost=0.00..4.98 rows=98 width=4) (never executed)

126. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.43..8.43 rows=1 width=8) (never executed)

127. 0.000 0.000 ↓ 0.0 0

Index Only Scan using seixfgcurrentinclude on dcdocrevision dr_4 (cost=0.41..8.43 rows=1 width=8) (never executed)

  • Index Cond: ((fgcurrent = 1) AND (cddocument = dc.cddocument))
  • Heap Fetches: 0
128. 0.000 0.000 ↓ 0.0 0

Index Only Scan using dcsecruleconddoc_pkey on dcsecruleconddoc src_1 (cost=0.15..8.17 rows=1 width=8) (never executed)

  • Index Cond: ((cdcondition = sru_1.cdcondition) AND (cddocument = dc.cddocument))
  • Heap Fetches: 0
129. 0.000 0.000 ↓ 0.0 0

Index Scan using pkdcdocument on dcdocument dd_1 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: (cddocument = dc.cddocument)
  • Filter: (fgusecataccessrole = 1)
130. 55.530 55.530 ↑ 1.0 1 18,510

Index Scan using pkgnrevision on gnrevision rv (cost=0.29..0.31 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=18,510)

  • Index Cond: (cdrevision = du.cdrevision)
131. 55.530 55.530 ↑ 1.0 1 18,510

Index Scan using pkaduser on aduser adu (cost=0.28..0.30 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=18,510)

  • Index Cond: (cduser = du.cduser)
  • Filter: (fguserenabled = 1)
132. 592.320 592.320 ↓ 0.0 0 18,510

Index Scan using dcdocumentuser_pk on dcdocumentuser du1 (cost=0.43..5.43 rows=1 width=12) (actual time=0.029..0.032 rows=0 loops=18,510)

  • Index Cond: ((cddocument = du.cddocument) AND (cduser = du.cduser))
  • Filter: (dttraining IS NOT NULL)
  • Rows Removed by Filter: 5
133.          

SubPlan (forGroupAggregate)

134. 35.276 92.540 ↑ 2.0 1 18,508

Append (cost=0.43..16.93 rows=2 width=4) (actual time=0.005..0.005 rows=1 loops=18,508)

135. 55.524 55.524 ↑ 1.0 1 18,508

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_8 (cost=0.43..8.46 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=18,508)

  • Index Cond: ((cdpermission = 18) AND (cduser = du.cduser) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 1))
  • Heap Fetches: 17638
136. 1.740 1.740 ↓ 0.0 0 870

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_9 (cost=0.43..8.46 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=870)

  • Index Cond: ((cdpermission = 18) AND (cduser = '-1'::integer) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 1))
  • Heap Fetches: 0
137. 52.914 141.104 ↓ 0.0 0 17,638

Append (cost=0.43..16.45 rows=2 width=4) (actual time=0.008..0.008 rows=0 loops=17,638)

138. 52.914 52.914 ↓ 0.0 0 17,638

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_10 (cost=0.43..8.21 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=17,638)

  • Index Cond: ((cdpermission = 18) AND (cduser = du.cduser) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
139. 35.276 35.276 ↓ 0.0 0 17,638

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_11 (cost=0.43..8.21 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=17,638)

  • Index Cond: ((cdpermission = 18) AND (cduser = '-1'::integer) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
140. 35.276 92.540 ↑ 2.0 1 18,508

Append (cost=0.43..16.93 rows=2 width=4) (actual time=0.005..0.005 rows=1 loops=18,508)

141. 55.524 55.524 ↑ 1.0 1 18,508

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_4 (cost=0.43..8.46 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=18,508)

  • Index Cond: ((cdpermission = 18) AND (cduser = du.cduser) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 1))
  • Heap Fetches: 17638
142. 1.740 1.740 ↓ 0.0 0 870

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_5 (cost=0.43..8.46 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=870)

  • Index Cond: ((cdpermission = 18) AND (cduser = '-1'::integer) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 1))
  • Heap Fetches: 0
143. 52.914 123.466 ↓ 0.0 0 17,638

Append (cost=0.43..16.45 rows=2 width=4) (actual time=0.007..0.007 rows=0 loops=17,638)

144. 35.276 35.276 ↓ 0.0 0 17,638

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_6 (cost=0.43..8.21 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=17,638)

  • Index Cond: ((cdpermission = 18) AND (cduser = du.cduser) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
145. 35.276 35.276 ↓ 0.0 0 17,638

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_7 (cost=0.43..8.21 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=17,638)

  • Index Cond: ((cdpermission = 18) AND (cduser = '-1'::integer) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
146. 35.276 92.540 ↑ 2.0 1 18,508

Append (cost=0.43..16.93 rows=2 width=4) (actual time=0.005..0.005 rows=1 loops=18,508)

147. 55.524 55.524 ↑ 1.0 1 18,508

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm (cost=0.43..8.46 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=18,508)

  • Index Cond: ((cdpermission = 18) AND (cduser = du.cduser) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 1))
  • Heap Fetches: 17638
148. 1.740 1.740 ↓ 0.0 0 870

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_1 (cost=0.43..8.46 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=870)

  • Index Cond: ((cdpermission = 18) AND (cduser = '-1'::integer) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 1))
  • Heap Fetches: 0
149. 52.914 123.466 ↓ 0.0 0 17,638

Append (cost=0.43..16.45 rows=2 width=4) (actual time=0.007..0.007 rows=0 loops=17,638)

150. 35.276 35.276 ↓ 0.0 0 17,638

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_2 (cost=0.43..8.21 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=17,638)

  • Index Cond: ((cdpermission = 18) AND (cduser = du.cduser) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
151. 35.276 35.276 ↓ 0.0 0 17,638

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_3 (cost=0.43..8.21 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=17,638)

  • Index Cond: ((cdpermission = 18) AND (cduser = '-1'::integer) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
Planning time : 74.574 ms
Execution time : 9,691.175 ms