Improving performance of SUBSTRING queries

Sometimes I see queries that use SUBSTRING in the query predicate.  This makes the query non-sargable (i.e. indexes aren’t usable). Example query: SELECT * FROM CustomerAccount WHERE SUBSTRING(AccountNbr, 0, CHARINDEX(‘-‘, AccountNbr)) = ‘999999’ This query is searching for an account number where everything up to the hyphen is stripped out.  Applying the SUBSTRING function causes […]

Read More

SQL Server compile locks

While they don’t occur very often, compile locks can become a problem with stored procedures.  This post will outline some common things to look for that can cause compile locks and how to address them. What is a compile lock? SQL Server keeps one version of an execution plan in the plan cache at any […]

Read More

Are you searching for a Precise I3 replacement?

I occasionally do consulting engagements for customers although our primary business is SQLGrease (database observability, performance monitoring).  I had a customer that used Precise I3.  Not a bad product, but it needed some updating as it had some quirks as they migrated from adobe flash to a web version.  They were acquired by Idera and […]

Read More