Functions in the WHERE Clause Are Bad… Right?
11 Comments
Nah, not necessarily. SQL Server’s query optimizer behavior keeps changing with every freakin’ version. Let’s illustrate it with a simple query against the Stack Overflow Users table: Transact-SQL CREATE INDEX Location ON dbo.Users(Location); GO SELECT COUNT(*) FROM dbo.Users WHERE Location = N'Ahmadabad, India' OPTION (RECOMPILE); 12345 CREATE INDEX Location ON dbo.Users(Location);GOSELECT COUNT(*) FROM dbo.Users WHERE Location…
Read More

















