*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
Util_IndexUsage
By Jesse Roberge - YeshuaAgapao@Yahoo.com
Reports index stats, index size+rows, member seek + include columns as two comma separated output columns, and index usage stats for one or more tables and/or schemas. Flexible parameterized sorting.
Has all the output of Util_ListIndexes plus the usage stats.
Required Input Parameters
none
Optional
@SchemaName sysname='' Filters schemas. Can use LIKE wildcards. All schemas if blank. Accepts LIKE Wildcards.
@TableName sysname='' Filters tables. Can use LIKE wildcards. All tables if blank. Accepts LIKE Wildcards.
@Sort Tinyint=5 Determines what to sort the results by:
Value Sort Columns
1 Score DESC, user_seeks DESC, user_scans DESC
2 Score ASC, user_seeks ASC, user_scans ASC
3 SchemaName ASC, TableName ASC, IndexName ASC
4 SchemaName ASC, TableName ASC, Score DESC
5 SchemaName ASC, TableName ASC, Score ASC
Usage:
EXECUTE Util_IndexUsage 'dbo', 'order%', 5
Copyright:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
see <http://www.fsf.org/licensing/licenses/lgpl.html> for the license text.
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=