Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
*.vsidx
*.lock
.DS_Store
/.vs
19 changes: 10 additions & 9 deletions sp_IndexCleanup/sp_IndexCleanup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
table_name sysname NOT NULL,
index_id integer NOT NULL,
index_name sysname NOT NULL,
can_compress bit NOT NULL
INDEX filtered_objects CLUSTERED
(database_id, schema_id, object_id, index_id)
can_compress bit NOT NULL
);

create CLUSTERED INDEX filtered_objects ON #filtered_objects (database_id, schema_id, object_id, index_id)

CREATE TABLE
#operational_stats
(
Expand Down Expand Up @@ -583,11 +583,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* When this is a target, the index which points to it as a supersedes in consolidation */
superseded_by nvarchar(4000) NULL,
/* Priority score from 0-1 to determine which index to keep (higher is better) */
index_priority decimal(10,6) NULL
INDEX index_analysis CLUSTERED
(database_id, schema_id, object_id, index_id)
index_priority decimal(10,6) NULL
);

CREATE CLUSTERED INDEX index_analysis on #index_analysis
(database_id, schema_id, object_id, index_id)

CREATE TABLE
#compression_eligibility
(
Expand Down Expand Up @@ -782,10 +783,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
index_name sysname NULL,
filter_definition nvarchar(max) NULL,
missing_included_columns nvarchar(max) NULL,
should_include_filter_columns bit NOT NULL,
INDEX c CLUSTERED
(database_id, schema_id, object_id, index_id)
should_include_filter_columns bit NOT NULL,
);
create CLUSTERED INDEX c ON #filtered_index_columns_analysis
(database_id, schema_id, object_id, index_id)

/* Parse @include_databases comma-separated list */
IF @get_all_databases = 1
Expand Down
Loading