Skip to content

Wrong table size filter expression in tip 1290 #64

@EitanBlumin

Description

@EitanBlumin

The parameter @CCICandidateMinSizeGB, based on its name, is in GB.
When it's used within the WHERE expression, it's divided by 1024 when compared against a value in MB:

      tos.table_size_mb > @CCICandidateMinSizeGB / 1024. -- consider sufficiently large tables only

However, dividing a number that represents GB by 1024 would represent TB, not MB.
In order to be represented in MB, it needs to be MULTIPLIED by 1024. Not divided by 1024.

Like this:

      tos.table_size_mb > @CCICandidateMinSizeGB * 1024. -- consider sufficiently large tables only

https://github.com/microsoft/azure-sql-tips/blob/main/sqldb-tips/get-sqldb-tips.sql#L3431

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions