Skip to content

Commit 588d02d

Browse files
Fixed 1290 (CCI candidates)
1 parent 030ddaf commit 588d02d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sqldb-tips/get-sqldb-tips-compat-level-100-only.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ IF EXISTS (SELECT 1 FROM @TipDefinition WHERE tip_id IN (1140) AND execute_indic
10191019
WITH allocated_used_space AS
10201020
(
10211021
SELECT SUM(CAST(size AS bigint) * 8 / 1024.) AS space_allocated_mb,
1022-
SUM(CAST(FILEPROPERTY(name, 'SpaceUsed') AS bigint)) / 1024. / 1024 AS space_used_mb
1022+
SUM(CAST(FILEPROPERTY(name, 'SpaceUsed') AS bigint)) * 8 / 1024. AS space_used_mb
10231023
FROM sys.database_files
10241024
WHERE type_desc = 'ROWS'
10251025
)
@@ -1032,7 +1032,7 @@ SELECT 1140 AS tip_id,
10321032
@CRLF
10331033
)
10341034
FROM allocated_used_space
1035-
WHERE space_used_mb * 8 / 1024. > @UsedToAllocatedSpaceDbMinSizeMB -- not relevant for small databases
1035+
WHERE space_used_mb > @UsedToAllocatedSpaceDbMinSizeMB -- not relevant for small databases
10361036
AND
10371037
@UsedToAllocatedSpaceThresholdRatio * space_allocated_mb > space_used_mb -- allocated space is more than N times used space
10381038
AND
@@ -3437,7 +3437,7 @@ ON t.object_id = ius.object_id
34373437
i.index_id = ius.index_id
34383438
WHERE i.type IN (0,1) -- clustered index or heap
34393439
AND
3440-
tos.table_size_mb > @CCICandidateMinSizeGB / 1024. -- consider sufficiently large tables only
3440+
tos.table_size_mb > @CCICandidateMinSizeGB * 1024. -- consider sufficiently large tables only
34413441
AND
34423442
t.is_ms_shipped = 0
34433443
AND

sqldb-tips/get-sqldb-tips.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ IF EXISTS (SELECT 1 FROM @TipDefinition WHERE tip_id IN (1140) AND execute_indic
10101010
WITH allocated_used_space AS
10111011
(
10121012
SELECT SUM(CAST(size AS bigint) * 8 / 1024.) AS space_allocated_mb,
1013-
SUM(CAST(FILEPROPERTY(name, 'SpaceUsed') AS bigint)) / 1024. / 1024 AS space_used_mb
1013+
SUM(CAST(FILEPROPERTY(name, 'SpaceUsed') AS bigint)) * 8 / 1024. AS space_used_mb
10141014
FROM sys.database_files
10151015
WHERE type_desc = 'ROWS'
10161016
)
@@ -1023,7 +1023,7 @@ SELECT 1140 AS tip_id,
10231023
@CRLF
10241024
)
10251025
FROM allocated_used_space
1026-
WHERE space_used_mb * 8 / 1024. > @UsedToAllocatedSpaceDbMinSizeMB -- not relevant for small databases
1026+
WHERE space_used_mb > @UsedToAllocatedSpaceDbMinSizeMB -- not relevant for small databases
10271027
AND
10281028
@UsedToAllocatedSpaceThresholdRatio * space_allocated_mb > space_used_mb -- allocated space is more than N times used space
10291029
AND
@@ -3435,7 +3435,7 @@ ON t.object_id = ius.object_id
34353435
i.index_id = ius.index_id
34363436
WHERE i.type IN (0,1) -- clustered index or heap
34373437
AND
3438-
tos.table_size_mb > @CCICandidateMinSizeGB / 1024. -- consider sufficiently large tables only
3438+
tos.table_size_mb > @CCICandidateMinSizeGB * 1024. -- consider sufficiently large tables only
34393439
AND
34403440
t.is_ms_shipped = 0
34413441
AND

0 commit comments

Comments
 (0)