Press "Enter" to skip to content

The SQL Server Optimizer and Data Types

Erik Darling turns on the logic machine:

Let me ask you a question: If I told you that all the numbers in an integer column were either:

1. > 0
2. >= 1

You’d probably agree that the lower number you could possible see is 1.

And that’s exactly the case with the Reputation column in Stack Overflow.

But as Erik points out, the optimizer doesn’t always see those as the same. Read on for an example.