Skip to content

SQLGrease SQL Server Performance tips

Performance tuning tips from the SQLGrease team

  • Blog Home
  • About Me
  • Contact Me
  • SQLGrease Home Page

Execution Plans

What happens with parameterized wildcards?

July 27, 2019December 31, 2019 ~ franklinyamamoto ~ 1 Comment

I’ve been curious of how the optimizer behaves when using parameterized SQL with a LIKE clause.  Wildcard values that have a wildcard character in front generally do not seek on indexes.  I was curious how the optimizer deals with this from a cached plan perspective – would placement of the wildcard character cause recompilations?  I […]

Read More

How STRING_SPLIT row estimates can affect performance

July 12, 2019August 4, 2022 ~ franklinyamamoto ~ 1 Comment

Recently someone brought a tweet to my attention regarding STRING_SPLIT and how performance of it was faster than table valued parameters (TVP). As you may have read in one of my prior posts TVP’s have issues related to lack of good row estimates.  This can be fixed with a little extra work.  STRING_SPLIT caught my […]

Read More

Index seeks and NULL values

July 6, 2019December 31, 2019 ~ franklinyamamoto

A long time ago I heard or read that you couldn’t index a NULL value – I didn’t think that was correct.  The other day I saw a missing index (as identified by the optimizer) where the first column was looking for a NULL value.  I was working on optimizing a process that was pretty […]

Read More

Why do I have multiple plans for one query?

July 6, 2019December 31, 2019 ~ franklinyamamoto

Have you ever been digging in your plan cache with either sys.dm_exec_query_stats or sys.dm_exec_procedure_stats and seen two identical queries with different execution plans?  When I say identical I’m referring to having the same sql_handle.  A sql_handle is generated based on the query text submitted to sql.  If one character is different (even white space) it […]

Read More

Join Hints – Careful, They Force Order!

March 9, 2019January 30, 2022 ~ franklinyamamoto ~ 1 Comment

Recently I was looking at a query generating deadlocks as a result of a clustered index scan.  I saw that someone forced a LOOP JOIN on one of the offending queries.  At first glance it appeared as if the LOOP JOIN should have made an index seek more likely; however, after remembering a side effect […]

Read More

How to view percent done for a long executing query

February 4, 2019December 31, 2019 ~ franklinyamamoto ~ 1 Comment

If you’ve ever wondered when a long running query was going to complete there is now a way to get some visibility into it.  Starting in SQL Server 2016 SP1 there is a lightweight query profiler that can be enabled with extended events or by enabling the 7412 trace flag.  When you enable this trace […]

Read More

Posts navigation

Next

Subscribe to our mailing list

* indicates required

Follow @sqlgrease

What are you waiting on?

Recent Posts

  • How CURSOR processing logic shows up in Query Store
  • Using GO in SSMS versus not – what is the difference
  • Unmatched Indexes plan warnings
  • No Join Predicate plan warning may be a red herring
  • Parallel plans can be selected with scalar UDF’s
  • What’s my parallel query waiting on?
  • Improving performance of SUBSTRING queries
  • Execution plan shortcuts causing random long executions
  • SQL Server compile locks
  • Are you searching for a Precise I3 replacement?
  • How to measure query runtime when developing/testing – part 3
  • Deadlock graphs now contain query hashes
  • RESOURCE_SEMAPHORE waits caused by OBJECTSTORE_LOCK_MANAGER memory usage
  • Opening an actual plan in a separate SSMS tab
  • How to measure query runtime when developing/testing – part 2
  • How to measure query runtime when developing/testing – part 1
  • OLEDB waits: what they mean and a few ideas on addressing them
  • STATMAN queries causing you timeouts?
  • What does the status column of a session mean in SQL Server?
  • Query store queries losing forced plans
~