Skip to content

Sql 2012 compatible index creation on temp tables #625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
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
18 changes: 9 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 IX_filtered_objects ON #filtered_objects (database_id, schema_id, object_id, index_id);

CREATE TABLE
#operational_stats
(
Expand Down Expand Up @@ -583,11 +583,11 @@ 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 IX_index_analysis ON #index_analysis(database_id, schema_id, object_id, index_id);

CREATE TABLE
#compression_eligibility
(
Expand Down Expand Up @@ -782,11 +782,11 @@ 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 IX_filtered_index_columns_analysis ON #filtered_index_columns_analysis (database_id, schema_id, object_id, index_id);

/* Parse @include_databases comma-separated list */
IF @get_all_databases = 1
AND @include_databases IS NOT NULL
Expand Down