explain.depesz.com

PostgreSQL's explain analyze made readable

Result: obxe

Settings
# exclusive inclusive rows x rows loops node
1. 0.263 59,970.766 ↑ 1.0 1 1

Aggregate (cost=113,087.64..113,087.65 rows=1 width=12) (actual time=59,970.764..59,970.766 rows=1 loops=1)

2. 0.668 59,970.503 ↓ 300.0 300 1

GroupAggregate (cost=113,087.50..113,087.62 rows=1 width=12) (actual time=59,932.568..59,970.503 rows=300 loops=1)

  • Group Key: dr.cddocument, dr.cdrevision
3. 19.971 59,969.835 ↓ 300.0 300 1

GroupAggregate (cost=113,087.50..113,087.59 rows=1 width=16) (actual time=59,932.414..59,969.835 rows=300 loops=1)

  • Group Key: dr.cddocument, dr.cdrevision
4. 48.158 59,949.864 ↓ 18,508.0 18,508 1

Sort (cost=113,087.50..113,087.50 rows=1 width=28) (actual time=59,932.236..59,949.864 rows=18,508 loops=1)

  • Sort Key: dr.cddocument, dr.cdrevision
  • Sort Method: external merge Disk: 688kB
5. 55.760 59,901.706 ↓ 18,508.0 18,508 1

Nested Loop Anti Join (cost=50,192.08..113,087.49 rows=1 width=28) (actual time=9,763.160..59,901.706 rows=18,508 loops=1)

  • Join Filter: (du1.cdrevision >= (max(dr1.cdrevision)))
  • Rows Removed by Join Filter: 7384
6. 1,140.849 59,087.036 ↓ 18,510.0 18,510 1

Merge Left Join (cost=50,191.65..113,082.05 rows=1 width=40) (actual time=9,763.044..59,087.036 rows=18,510 loops=1)

  • Merge Cond: (adu.cduser = perm.cduser)
  • Join Filter: (perm.cddocument = dr.cddocument)
  • Rows Removed by Join Filter: 1370319
7. 22,847.748 56,362.960 ↓ 18,510.0 18,510 1

Nested Loop (cost=800.73..58,333.82 rows=1 width=40) (actual time=9,481.426..56,362.960 rows=18,510 loops=1)

  • Join Filter: (du.cduser = adu.cduser)
  • Rows Removed by Join Filter: 30467460
8. 8.644 8.644 ↑ 1.0 1,647 1

Index Scan using pkaduser on aduser adu (cost=0.28..541.83 rows=1,647 width=4) (actual time=0.019..8.644 rows=1,647 loops=1)

  • Filter: (fguserenabled = 1)
9. 24,674.985 33,506.568 ↓ 18,510.0 18,510 1,647

Materialize (cost=800.45..57,767.29 rows=1 width=36) (actual time=0.044..20.344 rows=18,510 loops=1,647)

10. 49.714 8,831.583 ↓ 18,510.0 18,510 1

Nested Loop (cost=800.45..57,767.28 rows=1 width=36) (actual time=65.113..8,831.583 rows=18,510 loops=1)

  • Join Filter: (dr.cdrevision = rv.cdrevision)
11. 52.306 8,726.339 ↓ 18,510.0 18,510 1

Nested Loop (cost=800.17..57,766.96 rows=1 width=36) (actual time=65.099..8,726.339 rows=18,510 loops=1)

  • Join Filter: (dr.cddocument = dc.cddocument)
12. 35.715 1,386.994 ↓ 21,883.0 21,883 1

Nested Loop (cost=799.89..57,699.87 rows=1 width=40) (actual time=63.451..1,386.994 rows=21,883 loops=1)

13. 5.639 1,024.293 ↓ 1,837.0 1,837 1

Nested Loop (cost=799.46..57,691.41 rows=1 width=24) (actual time=62.781..1,024.293 rows=1,837 loops=1)

14. 5.833 1,013.143 ↓ 229.6 1,837 1

Nested Loop (cost=799.32..57,686.85 rows=8 width=20) (actual time=62.771..1,013.143 rows=1,837 loops=1)

15. 7.715 64.929 ↓ 2.1 1,837 1

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

  • Group Key: dr1.cddocument
  • Filter: (max(dr1.cdrevision) IS NOT NULL)
16. 18.395 57.214 ↓ 4.5 4,021 1

Hash Join (cost=389.27..792.32 rows=895 width=8) (actual time=26.700..57.214 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
17. 12.590 12.590 ↑ 1.0 12,093 1

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

18. 5.300 26.229 ↓ 4.5 4,186 1

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

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 261kB
19. 11.774 20.929 ↓ 4.5 4,186 1

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

  • Hash Cond: (dr1.cdcategory = dccat.cdcategory)
20. 9.073 9.073 ↑ 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.019..9.073 rows=6,558 loops=1)

  • Index Cond: (fgtrainrequired = 1)
21. 0.024 0.082 ↑ 1.0 14 1

Hash (cost=5.22..5.22 rows=14 width=12) (actual time=0.081..0.082 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
22. 0.058 0.058 ↑ 1.0 14 1

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

  • Filter: (fgenabledtraining = 1)
  • Rows Removed by Filter: 84
23. 21.474 942.381 ↑ 1.0 1 1,837

Index Scan using seixdocrecddocumen on dcdocrevision dr (cost=0.29..63.53 rows=1 width=12) (actual time=0.484..0.513 rows=1 loops=1,837)

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

SubPlan (for Index Scan)

25. 16.668 920.907 ↑ 1.0 1 4,167

Aggregate (cost=30.88..30.89 rows=1 width=4) (actual time=0.220..0.221 rows=1 loops=4,167)

26. 59.907 904.239 ↑ 1.0 1 4,167

Nested Loop (cost=9.00..30.87 rows=1 width=4) (actual time=0.094..0.217 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
27. 370.863 766.728 ↓ 2.5 5 4,167

Hash Join (cost=8.72..14.21 rows=2 width=16) (actual time=0.083..0.184 rows=5 loops=4,167)

  • Hash Cond: (ct1.cdcategory = dr1_1.cdcategory)
28. 333.360 333.360 ↑ 1.0 98 4,167

Seq Scan on dccategory ct1 (cost=0.00..4.98 rows=98 width=12) (actual time=0.002..0.080 rows=98 loops=4,167)

29. 25.002 62.505 ↓ 2.5 5 4,167

Hash (cost=8.69..8.69 rows=2 width=12) (actual time=0.015..0.015 rows=5 loops=4,167)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
30. 37.503 37.503 ↓ 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.003..0.009 rows=5 loops=4,167)

  • Index Cond: (cddocument = dr.cddocument)
31. 77.604 77.604 ↑ 1.0 1 19,401

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

  • Index Cond: (cdrevision = dr1_1.cdrevision)
32. 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)
33. 326.986 326.986 ↓ 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.138..0.178 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
34. 111.917 7,287.039 ↑ 1.0 1 21,883

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

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

SubPlan (for Index Scan)

36. 37.468 6,912.846 ↓ 0.0 0 18,734

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

37. 37.468 3,428.322 ↓ 0.0 0 18,734

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

38. 56.202 3,390.854 ↓ 0.0 0 18,734

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

39. 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 = 1162) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
40. 18.734 3,091.110 ↓ 0.0 0 18,734

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

41. 56.202 3,072.376 ↓ 0.0 0 18,734

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

42. 18.734 3,016.174 ↓ 0.0 0 18,734

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

  • Join Filter: (pc_2.cdcategory = dr_5.cdcategory)
43. 1,536.174 2,997.440 ↓ 0.0 0 18,734

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

  • Hash Cond: (c_4.cdcategory = pc_2.cdcategory)
44. 1,461.252 1,461.252 ↑ 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.078 rows=98 loops=18,734)

45. 0.002 0.014 ↓ 0.0 0 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
46. 0.012 0.012 ↓ 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.012 rows=0 loops=1)

  • Index Cond: ((cdpermission = 10) AND (cduser = 1162) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
47. 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
48. 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)
49. 37.468 187.340 ↓ 0.0 0 18,734

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

50. 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
51. 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)

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

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

54. 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 = 1162) AND (cdpermission = 10) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
55. 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
56. 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)
57. 0.000 0.000 ↓ 0.0 0

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

58. 0.000 0.000 ↓ 0.0 0

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

59. 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
60. 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)
61. 37.468 3,447.056 ↓ 0.0 0 18,734

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

62. 74.936 3,409.588 ↓ 0.0 0 18,734

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

63. 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
64. 18.734 3,109.844 ↓ 0.0 0 18,734

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

65. 56.202 3,091.110 ↓ 0.0 0 18,734

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

66. 18.734 3,034.908 ↓ 0.0 0 18,734

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

  • Join Filter: (pc_3.cdcategory = dr_7.cdcategory)
67. 1,517.441 3,016.174 ↓ 0.0 0 18,734

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

  • Hash Cond: (c_6.cdcategory = pc_3.cdcategory)
68. 1,498.720 1,498.720 ↑ 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.080 rows=98 loops=18,734)

69. 0.002 0.013 ↓ 0.0 0 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
70. 0.011 0.011 ↓ 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.011 rows=0 loops=1)

  • Index Cond: ((cdpermission = 10) AND (cduser = '-1'::integer) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
71. 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
72. 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)
73. 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)

74. 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
75. 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)

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

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

78. 37.468 37.468 ↓ 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.002..0.002 rows=0 loops=18,734)

  • Index Cond: ((cduser = '-1'::integer) AND (cdpermission = 10) AND (fgpermissiontype = 2))
  • Heap Fetches: 0
79. 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
80. 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)
81. 0.000 0.000 ↓ 0.0 0

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

82. 0.000 0.000 ↓ 0.0 0

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

83. 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
84. 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)
85. 30.584 262.276 ↑ 6.0 1 18,734

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

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

87. 31.032 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)

88. 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 = 1162) AND (cddocument = dc.cddocument) AND (fgpermissiontype = 1))
  • Heap Fetches: 18510
89. 0.448 41.888 ↓ 0.0 0 224

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

90. 0.658 41.440 ↓ 0.0 0 224

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

91. 1.344 40.320 ↑ 1.0 1 224

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

  • Join Filter: (dr_1.cdcategory = pc.cdcategory)
92. 18.816 38.304 ↑ 1.0 1 224

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

  • Hash Cond: (c.cdcategory = dr_1.cdcategory)
93. 17.472 17.472 ↑ 1.0 98 224

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

94. 0.672 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
95. 1.344 1.344 ↑ 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.005..0.006 rows=1 loops=224)

  • Index Cond: ((fgcurrent = 1) AND (cddocument = dc.cddocument))
  • Heap Fetches: 224
96. 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 = 1162) AND (cdcategory = c.cdcategory) AND (fgpermissiontype = 1))
  • Heap Fetches: 154
97. 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
98. 0.224 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)

99. 0.448 1.792 ↓ 0.0 0 224

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

  • Group Key: sru.cdpermission, src.cddocument, sru.cduser, sru.fgpermissiontype
100. 0.224 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)

101. 0.448 1.120 ↓ 0.0 0 224

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

102. 0.224 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)

103. 0.448 0.448 ↓ 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.002..0.002 rows=0 loops=224)

  • Index Cond: ((cduser = 1162) AND (cdpermission = 10) AND (fgpermissiontype = 1))
  • Heap Fetches: 0
104. 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)
105. 0.000 0.000 ↓ 0.0 0

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

106. 0.000 0.000 ↓ 0.0 0

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

107. 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
108. 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
109. 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)
110. 0.224 44.352 ↓ 0.0 0 224

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

111. 0.672 44.128 ↓ 0.0 0 224

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

112. 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
113. 0.448 40.544 ↓ 0.0 0 224

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

114. 0.448 40.096 ↓ 0.0 0 224

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

115. 1.120 39.648 ↓ 0.0 0 224

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

  • Join Filter: (dr_3.cdcategory = pc_1.cdcategory)
116. 18.592 37.856 ↑ 1.0 1 224

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

  • Hash Cond: (c_2.cdcategory = dr_3.cdcategory)
117. 17.472 17.472 ↑ 1.0 98 224

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

118. 0.672 1.792 ↑ 1.0 1 224

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
119. 1.120 1.120 ↑ 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.004..0.005 rows=1 loops=224)

  • Index Cond: ((fgcurrent = 1) AND (cddocument = dc.cddocument))
  • Heap Fetches: 224
120. 0.672 0.672 ↓ 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.003..0.003 rows=0 loops=224)

  • Index Cond: ((cdpermission = 10) AND (cduser = '-1'::integer) AND (cdcategory = c_2.cdcategory) AND (fgpermissiontype = 1))
  • Heap Fetches: 0
121. 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)
122. 0.448 2.240 ↓ 0.0 0 224

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

123. 0.448 1.792 ↓ 0.0 0 224

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

  • Group Key: sru_1.cdpermission, src_1.cddocument, sru_1.cduser, sru_1.fgpermissiontype
124. 0.224 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)

125. 0.448 1.120 ↓ 0.0 0 224

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

126. 0.224 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)

127. 0.448 0.448 ↓ 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.002..0.002 rows=0 loops=224)

  • Index Cond: ((cduser = '-1'::integer) AND (cdpermission = 10) AND (fgpermissiontype = 1))
  • Heap Fetches: 0
128. 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)
129. 0.000 0.000 ↓ 0.0 0

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

130. 0.000 0.000 ↓ 0.0 0

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

131. 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
132. 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
133. 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)
134. 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)
135. 1,006.337 1,583.227 ↓ 6.0 1,424,745 1

Materialize (cost=49,390.92..54,151.36 rows=238,022 width=12) (actual time=272.741..1,583.227 rows=1,424,745 loops=1)

136. 113.062 576.890 ↑ 2.8 84,011 1

Subquery Scan on perm (cost=49,390.92..53,556.30 rows=238,022 width=12) (actual time=272.731..576.890 rows=84,011 loops=1)

137. 120.578 463.828 ↑ 2.8 84,011 1

Unique (cost=49,390.92..51,176.08 rows=238,022 width=8) (actual time=272.728..463.828 rows=84,011 loops=1)

138. 158.142 343.250 ↑ 2.8 84,592 1

Sort (cost=49,390.92..49,985.97 rows=238,022 width=8) (actual time=272.725..343.250 rows=84,592 loops=1)

  • Sort Key: pm.cduser, pm.cddocument
  • Sort Method: external merge Disk: 1512kB
139. 98.156 185.108 ↑ 2.8 84,766 1

Append (cost=1,561.97..21,624.68 rows=238,022 width=8) (actual time=2.579..185.108 rows=84,766 loops=1)

140. 73.298 75.717 ↑ 1.0 81,472 1

Bitmap Heap Scan on dcuserpermissiondoc pm (cost=1,561.97..16,859.68 rows=83,204 width=8) (actual time=2.577..75.717 rows=81,472 loops=1)

  • Recheck Cond: (cdpermission = 18)
  • Filter: ((cduser <> '-1'::integer) AND (fgpermissiontype = 1))
  • Rows Removed by Filter: 2
  • Heap Blocks: exact=1787
141. 2.419 2.419 ↑ 1.0 81,474 1

Bitmap Index Scan on seixdcuserpermdoccdperm (cost=0.00..1,541.17 rows=83,298 width=0) (actual time=2.418..2.419 rows=81,474 loops=1)

  • Index Cond: (cdpermission = 18)
142. 6.367 11.235 ↑ 47.0 3,294 1

Nested Loop (cost=0.71..2,384.78 rows=154,818 width=8) (actual time=0.032..11.235 rows=3,294 loops=1)

143. 1.574 1.574 ↑ 1.0 1,647 1

Index Only Scan using seixusernmfgencdus on aduser us (cost=0.28..89.10 rows=1,647 width=4) (actual time=0.016..1.574 rows=1,647 loops=1)

  • Index Cond: (fguserenabled = 1)
  • Heap Fetches: 0
144. 3.281 3.294 ↑ 47.0 2 1,647

Materialize (cost=0.43..360.69 rows=94 width=4) (actual time=0.001..0.002 rows=2 loops=1,647)

145. 0.013 0.013 ↑ 47.0 2 1

Index Only Scan using dcuserpermissiondoc_pk on dcuserpermissiondoc pm_1 (cost=0.43..360.22 rows=94 width=4) (actual time=0.010..0.013 rows=2 loops=1)

  • Index Cond: ((cdpermission = 18) AND (cduser = '-1'::integer) AND (fgpermissiontype = 1))
  • Heap Fetches: 2
146. 758.910 758.910 ↓ 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.037..0.041 rows=0 loops=18,510)

  • Index Cond: ((cddocument = du.cddocument) AND (cduser = du.cduser))
  • Filter: (dttraining IS NOT NULL)
  • Rows Removed by Filter: 5
Planning time : 36.240 ms
Execution time : 59,973.048 ms