March 2009 Blog Posts

Low-Hanging Fruit of Sargable Expressions

Can you spot the performance problem with the two queries below? These queries both illustrate a common and nasty performance problem that robs CPU cycles and consumes I/O bandwidth. CREATE TABLE dbo.Foo(     Bar varchar(10) NOT NULL             CONSTRAINT PK_Foo PRIMARY KEY CLUSTERED, ...