DatabaseProcApplicationCreatedLinks
sybsystemprocssp_help_qpgroup  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = "%Z% generic/sproc/%M% %I% %G%" */
3     
4     /*
5     ** Messages for "sp_help_qpgroup"
6     **
7     ** 18641, "Query plan groups in database '%1!'"
8     ** 18639, "The is no query plans group named '%1!' in this database."
9     ** 18642, "Query plans group '%1!', GID %2!"
10    ** 18643, "sysqueryplans rows consumption, number of query plans per row count"
11    ** 18644, "Query plans that use the most sysqueryplans rows"
12    ** 18645, "There is no hash key collision in this group."
13    ** 18646, "Number of collisions per hash key"
14    ** 18647, "Colliding query plan IDs per hash key"
15    ** 18648, "Query plans in this group"
16    ** 18640, "Unknown %1! option : '%2!'. Valid options are : %3!."
17    ** 18649, "The query plans group is empty."
18    */
19    
20    /*
21    ** sp_help_qpgroup displays information about an AP group. The legal 
22    ** modes are : "full", "stats", "hash", "list", "queries", "plans" 
23    ** or "counts".
24    */
25    
26    create or replace procedure sp_help_qpgroup
27        @name varchar(255) = null,
28        @mode varchar(20) = "full"
29    as
30        declare
31            @msg varchar(1024),
32            @uid int,
33            @gid int,
34            @class int,
35            @attribute int,
36            @object_type char(2),
37            @dummy int,
38            @nullarg char(1),
39            @gp_enabled int,
40            @dbname varchar(255),
41            @status int
42    
43        set nocount on
44    
45        select @dbname = db_name()
46    
47        /* Don't start a transaction for the user, he does not expect it. */
48        if @@trancount = 0
49        begin
50            set chained off
51        end
52    
53        /* Don't hold long READ locks, the user might not appreciate it. */
54        set transaction isolation level 1
55    
56        /*
57        **  Only the Database Owner (DBO) or
58        **  Accounts with SA role can execute it.
59        **  If the user has SA role, it's uid will
60        **  be DBO uid (1). If granular permissions is enabled then
61        **  users with 'manage abstract plans' permission can execute it.
62        */
63    
64        select @nullarg = NULL
65    
66        execute @status = sp_aux_checkroleperm "dbo",
67            "manage abstract plans", @dbname, @gp_enabled output
68    
69        /* 
70        ** If @status = 0, user is dbo, has sa_role or if granular permissions
71        ** is enabled has 'manage abstract plans' permission.  Therefore the
72        ** user can see all query plans in the group.
73        */
74        if (@status = 0)
75            select @uid = NULL
76        else
77            select @uid = user_id()
78    
79        exec sp_aux_sargs_qpgroup @class out, @attribute out, @object_type out
80    
81        if @name is null
82        begin
83            select @name = db_name()
84    
85            /* 18641, "Query plan groups in database '%1!'" */
86            exec sp_getmessage 18641, @msg out
87            print @msg, @name
88    
89            select object_cinfo,
90                GID = object,
91                Plans = count(distinct id)
92            into #sphelpqpgroup1rs
93            from sysattributes, sysqueryplans
94            where class = @class
95                and attribute = @attribute
96                and object_type = @object_type
97                and uid = isnull(@uid, uid)
98                and object *= gid
99            group by object_cinfo, gid
100           exec sp_autoformat @fulltabname = #sphelpqpgroup1rs,
101               @selectlist = "'Group' = object_cinfo, GID, Plans",
102               @orderby = "order by 1"
103           drop table #sphelpqpgroup1rs
104   
105           return 0
106       end
107   
108       exec sp_aux_get_qpgroup @name, @gid out
109   
110       if @gid is null
111       begin
112           /* 18639, "The is no query plans group named '%1!' in this database." */
113           raiserror 18639, @name
114   
115           return 1
116       end
117   
118       /* 18642, "Query plans group '%1!', GID %2!" */
119       exec sp_getmessage 18642, @msg out
120       print ""
121       print @msg, @name, @gid
122       print ""
123   
124       select count(*) as "Total Rows", count(distinct id) as "Total QueryPlans"
125       from sysqueryplans
126       where
127           uid = isnull(@uid, uid)
128           and gid = @gid
129   
130       -- group summary modes
131   
132       if (@mode = "stats" or @mode = "full")
133       begin
134           select id, count(*) as cnt
135           into #rows
136           from sysqueryplans
137           where uid = isnull(@uid, uid)
138               and gid = @gid
139           group by id
140   
141           /* 18643, "sysqueryplans rows consumption, number of query plans per row count" */
142           exec sp_getmessage 18643, @msg out
143           print @msg
144   
145           select cnt as "Rows", count(*) as "Plans"
146           from #rows
147           group by cnt
148           order by cnt desc
149   
150           if @@rowcount > 1
151           begin
152               /* 18644, "Query plans that use the most sysqueryplans rows" */
153               exec sp_getmessage 18644, @msg out
154               print @msg
155   
156               select cnt as "Rows", id as "Plan"
157               from #rows
158               where cnt > (select avg(cnt) + 1
159                       from #rows)
160               order by cnt desc, id
161           end
162   
163           if @mode != "full"
164               return 0
165       end
166   
167       if (@mode = "hash" or @mode = "full")
168       begin
169           select count(distinct hashkey) as "Hashkeys"
170           from sysqueryplans
171           where uid = isnull(@uid, uid)
172               and gid = @gid
173               and type = 10
174               and sequence = 0
175   
176           select hashkey, count(*) as collisions
177           into #colls
178           from sysqueryplans o
179           where uid = isnull(@uid, uid)
180               and gid = @gid
181               and type = 10
182               and sequence = 0
183               and exists (select *
184                   from sysqueryplans
185                   where uid = o.uid
186                       and gid = o.gid
187                       and hashkey = o.hashkey
188                       and id != o.id)
189           group by hashkey
190   
191           if @@rowcount = 0
192           begin
193               /* 18645, "There is no hash key collision in this group." */
194               exec sp_getmessage 18645, @msg out
195               print @msg
196           end
197           else
198           begin
199               /* 18646, "Number of collisions per hash key" */
200               exec sp_getmessage 18646, @msg out
201               print @msg
202   
203               select collisions, hashkey from #colls
204               order by collisions desc, hashkey
205   
206               /* 18647, "Colliding query plan IDs per hash key" */
207               exec sp_getmessage 18647, @msg out
208               print @msg
209   
210               select c.collisions, c.hashkey, q.id
211               from #colls c, sysqueryplans q
212               where gid = @gid
213                   and c.hashkey = q.hashkey
214               group by c.collisions, c.hashkey, q.id
215               order by c.collisions, c.hashkey, q.id
216           end
217   
218           if @mode != "full"
219               return 0
220       end
221   
222       if @mode = "full"
223           return 0
224   
225       -- per plan modes
226   
227       /* 18648, "Query plans in this group" */
228       exec sp_getmessage 18648, @msg out
229   
230       print ""
231       print @msg
232   
233       if (@mode = "list")
234       begin
235           select hashkey, id,
236                   (select substring(text, 1, 20) + "..."
237                   from sysqueryplans i
238                   where o.id = i.id
239                       and type = 10
240                       and sequence = 0) as "query",
241                   (select substring(text, 1, 20) + "..."
242                   from sysqueryplans i
243                   where o.id = i.id
244                       and type = 100
245                       and sequence = 0) as "plan"
246           from sysqueryplans o
247           where uid = isnull(@uid, uid)
248               and gid = @gid
249           group by hashkey, id
250           order by hashkey, id
251   
252           goto finish
253       end
254   
255       if (@mode = "queries")
256       begin
257           select hashkey, id,
258                   (select substring(text, 1, 50) + "..."
259                   from sysqueryplans i
260                   where o.id = i.id
261                       and type = 10
262                       and sequence = 0) as "query"
263           from sysqueryplans o
264           where uid = isnull(@uid, uid)
265               and gid = @gid
266           group by hashkey, id
267           order by hashkey, id
268   
269           goto finish
270       end
271   
272       if (@mode = "plans")
273       begin
274           select hashkey, id,
275                   (select substring(text, 1, 50) + "..."
276                   from sysqueryplans i
277                   where o.id = i.id
278                       and type = 100
279                       and sequence = 0) as "plan"
280           from sysqueryplans o
281           where uid = isnull(@uid, uid)
282               and gid = @gid
283           group by hashkey, id
284           order by hashkey, id
285   
286           goto finish
287       end
288   
289       if (@mode = "counts")
290       begin
291           select count(*) as "Rows",
292               sum(char_length(text)) as "Chars",
293               hashkey, id,
294                   (select substring(text, 1, 25) + "..."
295                   from sysqueryplans i
296                   where o.id = i.id
297                       and type = 10
298                       and sequence = 0) as "query"
299           from sysqueryplans o
300           where uid = isnull(@uid, uid)
301               and gid = @gid
302           group by hashkey, id
303           order by 1 desc, 2 desc, hashkey, id
304   
305           goto finish
306       end
307   
308       /* 18640, "Unknown %1! option : '%2!'. Valid options are : %3!." */
309       raiserror 18640, "sp_help_qpgroup", @mode, "'full', 'stats', 'hash', 'list', 'queries', 'plans', 'counts'"
310   
311       return 1
312   
313   finish:
314       if @@rowcount = 0
315       begin
316           /* 18649, "The query plans group is empty." */
317           exec sp_getmessage 18649, @msg out
318           print @msg
319       end
320   
321       return 0
322   


exec sp_procxmode 'sp_help_qpgroup', 'AnyMode'
go

Grant Execute on sp_help_qpgroup to public
go
RESULT SETS
sp_help_qpgroup_rset_010
sp_help_qpgroup_rset_009
sp_help_qpgroup_rset_008
sp_help_qpgroup_rset_007
sp_help_qpgroup_rset_006
sp_help_qpgroup_rset_005
sp_help_qpgroup_rset_004
sp_help_qpgroup_rset_003
sp_help_qpgroup_rset_002
sp_help_qpgroup_rset_001

DEFECTS
 QBGB 6 Bad group by object 90
 QJWI 5 Join or Sarg Without Index 98
 MEST 4 Empty String will be replaced by Single Space 120
 MEST 4 Empty String will be replaced by Single Space 122
 MEST 4 Empty String will be replaced by Single Space 230
 MINU 4 Unique Index with nullable columns sybsystemprocs..sysattributes sybsystemprocs..sysattributes
 MTYP 4 Assignment type mismatch @name: varchar(30) = varchar(255) 108
 MUSP 4 Unquoted String Parameter sybsystemprocs..sp_autoformat: @fulltabname 100
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {gid}
128
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {gid}
138
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {gid, type, sequence}
172
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {gid, type, sequence}
180
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {hashkey}
Uncovered: [uid, id, type, sequence]
213
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {id}
Uncovered: [uid, gid, hashkey, type, sequence]
238
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {id}
Uncovered: [uid, gid, hashkey]
238
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {id}
Uncovered: [uid, gid, hashkey, type, sequence]
243
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {id}
Uncovered: [uid, gid, hashkey]
243
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {gid}
248
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {id}
Uncovered: [uid, gid, hashkey, type, sequence]
260
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {id}
Uncovered: [uid, gid, hashkey]
260
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {gid}
265
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {id}
Uncovered: [uid, gid, hashkey, type, sequence]
277
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {id}
Uncovered: [uid, gid, hashkey]
277
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {gid}
282
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {id}
Uncovered: [uid, gid, hashkey, type, sequence]
296
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {id}
Uncovered: [uid, gid, hashkey]
296
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysqueryplans.csysqueryplans unique clustered
(uid, gid, hashkey, id, type, sequence)
Intersection: {gid}
301
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 94
 QTYP 4 Comparison type mismatch smallint = int 94
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 95
 QTYP 4 Comparison type mismatch smallint = int 95
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 173
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 174
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 181
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 182
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 239
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 240
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 244
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 245
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 261
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 262
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 278
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 279
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 297
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 298
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 91
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 124
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 134
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 139
 MAW1 3 Warning message on %name% tempdb..#rows.id: Warning message on #rows_crby_sybsystemprocs__sp_help_qpgroup 156
 MAW1 3 Warning message on %name% tempdb..#rows.id: Warning message on #rows_crby_sybsystemprocs__sp_help_qpgroup 160
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 188
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 210
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 214
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 215
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 235
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 238
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 243
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 249
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 250
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 257
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 260
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 266
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 267
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 274
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 277
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 283
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 284
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 293
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 296
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 302
 MAW1 3 Warning message on %name% sybsystemprocs..sysqueryplans.id: Warning message on sysqueryplans 303
 MGTP 3 Grant to public sybsystemprocs..sp_help_qpgroup  
 MGTP 3 Grant to public sybsystemprocs..sysattributes  
 MGTP 3 Grant to public sybsystemprocs..sysqueryplans  
 MNEJ 3 'Not Equal' join 188
 MNER 3 No Error Check should check return value of exec 79
 MNER 3 No Error Check should check return value of exec 86
 MNER 3 No Error Check should check @@error after select into 89
 MNER 3 No Error Check should check return value of exec 100
 MNER 3 No Error Check should check return value of exec 108
 MNER 3 No Error Check should check return value of exec 119
 MNER 3 No Error Check should check @@error after select into 134
 MNER 3 No Error Check should check return value of exec 142
 MNER 3 No Error Check should check return value of exec 153
 MNER 3 No Error Check should check @@error after select into 176
 MNER 3 No Error Check should check return value of exec 194
 MNER 3 No Error Check should check return value of exec 200
 MNER 3 No Error Check should check return value of exec 207
 MNER 3 No Error Check should check return value of exec 228
 MNER 3 No Error Check should check return value of exec 317
 MUCO 3 Useless Code Useless Brackets 74
 MUCO 3 Useless Code Useless Brackets 132
 MUCO 3 Useless Code Useless Brackets 167
 MUCO 3 Useless Code Useless Brackets 233
 MUCO 3 Useless Code Useless Brackets 255
 MUCO 3 Useless Code Useless Brackets 272
 MUCO 3 Useless Code Useless Brackets 289
 QCRS 3 Conditional Result Set 145
 QCRS 3 Conditional Result Set 156
 QCRS 3 Conditional Result Set 169
 QCRS 3 Conditional Result Set 203
 QCRS 3 Conditional Result Set 210
 QCRS 3 Conditional Result Set 235
 QCRS 3 Conditional Result Set 257
 QCRS 3 Conditional Result Set 274
 QCRS 3 Conditional Result Set 291
 QCTC 3 Conditional Table Creation 89
 QCTC 3 Conditional Table Creation 134
 QCTC 3 Conditional Table Creation 176
 QISO 3 Set isolation level 54
 QNAJ 3 Not using ANSI Inner Join 211
 QNAO 3 Not using ANSI Outer Join 93
 QNUA 3 Should use Alias: Column object_cinfo should use alias sysattributes 89
 QNUA 3 Should use Alias: Column object should use alias sysattributes 90
 QNUA 3 Should use Alias: Column id should use alias sysqueryplans 91
 QNUA 3 Should use Alias: Table sybsystemprocs..sysattributes 93
 QNUA 3 Should use Alias: Table sybsystemprocs..sysqueryplans 93
 QNUA 3 Should use Alias: Column class should use alias sysattributes 94
 QNUA 3 Should use Alias: Column attribute should use alias sysattributes 95
 QNUA 3 Should use Alias: Column object_type should use alias sysattributes 96
 QNUA 3 Should use Alias: Column uid should use alias sysqueryplans 97
 QNUA 3 Should use Alias: Column gid should use alias sysqueryplans 98
 QNUA 3 Should use Alias: Column object should use alias sysattributes 98
 QNUA 3 Should use Alias: Column gid should use alias sysqueryplans 99
 QNUA 3 Should use Alias: Column object_cinfo should use alias sysattributes 99
 QNUA 3 Should use Alias: Column gid should use alias q 212
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysattributes.csysattributes unique clustered
(class, attribute, object_type, object, object_info1, object_info2, object_info3, object_cinfo)
Intersection: {class, object_type, attribute}
94
 VNRD 3 Variable is not read @nullarg 64
 VNRD 3 Variable is not read @gp_enabled 67
 VUNU 3 Variable is not used @dummy 37
 MRST 2 Result Set Marker 124
 MRST 2 Result Set Marker 145
 MRST 2 Result Set Marker 156
 MRST 2 Result Set Marker 169
 MRST 2 Result Set Marker 203
 MRST 2 Result Set Marker 210
 MRST 2 Result Set Marker 235
 MRST 2 Result Set Marker 257
 MRST 2 Result Set Marker 274
 MRST 2 Result Set Marker 291
 MSUC 2 Correlated Subquery Marker 183
 MSUC 2 Correlated Subquery Marker 236
 MSUC 2 Correlated Subquery Marker 241
 MSUC 2 Correlated Subquery Marker 258
 MSUC 2 Correlated Subquery Marker 275
 MSUC 2 Correlated Subquery Marker 294
 MTR1 2 Metrics: Comments Ratio Comments: 27% 26
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 28 = 31dec - 5exi + 2 26
 MTR3 2 Metrics: Query Complexity Complexity: 170 26
 PRED_QUERY_COLLECTION 2 {q=sybsystemprocs..sysqueryplans, q2=sybsystemprocs..sysqueryplans} 0 183
 PRED_QUERY_COLLECTION 2 {q=sybsystemprocs..sysqueryplans, q2=sybsystemprocs..sysqueryplans} 0 236
 PRED_QUERY_COLLECTION 2 {q=sybsystemprocs..sysqueryplans, q2=sybsystemprocs..sysqueryplans} 0 241
 PRED_QUERY_COLLECTION 2 {q=sybsystemprocs..sysqueryplans, q2=sybsystemprocs..sysqueryplans} 0 258
 PRED_QUERY_COLLECTION 2 {q=sybsystemprocs..sysqueryplans, q2=sybsystemprocs..sysqueryplans} 0 275
 PRED_QUERY_COLLECTION 2 {q=sybsystemprocs..sysqueryplans, q2=sybsystemprocs..sysqueryplans} 0 294

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_aux_get_qpgroup  
   reads table sybsystemprocs..sysattributes  
   calls proc sybsystemprocs..sp_aux_sargs_qpgroup  
read_writes table tempdb..#rows (1) 
writes table sybsystemprocs..sp_help_qpgroup_rset_005 
writes table sybsystemprocs..sp_help_qpgroup_rset_004 
writes table sybsystemprocs..sp_help_qpgroup_rset_009 
writes table sybsystemprocs..sp_help_qpgroup_rset_001 
writes table sybsystemprocs..sp_help_qpgroup_rset_008 
reads table sybsystemprocs..sysattributes  
writes table tempdb..#sphelpqpgroup1rs (1) 
writes table sybsystemprocs..sp_help_qpgroup_rset_006 
writes table sybsystemprocs..sp_help_qpgroup_rset_002 
writes table sybsystemprocs..sp_help_qpgroup_rset_003 
calls proc sybsystemprocs..sp_autoformat  
   reads table tempdb..systypes (1)  
   writes table sybsystemprocs..sp_autoformat_rset_001 
   read_writes table tempdb..#colinfo_af (1) 
   writes table sybsystemprocs..sp_autoformat_rset_005 
   writes table sybsystemprocs..sp_autoformat_rset_003 
   reads table master..systypes (1)  
   writes table sybsystemprocs..sp_autoformat_rset_004 
   calls proc sybsystemprocs..sp_autoformat  
   calls proc sybsystemprocs..sp_namecrack  
   writes table sybsystemprocs..sp_autoformat_rset_002 
   reads table master..syscolumns (1)  
   reads table tempdb..syscolumns (1)  
calls proc sybsystemprocs..sp_aux_checkroleperm  
   reads table master..sysconfigures (1)  
   reads table master..syscurconfigs (1)  
calls proc sybsystemprocs..sp_getmessage  
   reads table master..sysmessages (1)  
   reads table master..syslanguages (1)  
   reads table sybsystemprocs..sysusermessages  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)  
writes table sybsystemprocs..sp_help_qpgroup_rset_007 
writes table sybsystemprocs..sp_help_qpgroup_rset_010 
read_writes table tempdb..#colls (1) 
reads table sybsystemprocs..sysqueryplans  
calls proc sybsystemprocs..sp_aux_sargs_qpgroup