Big One Time Use Queries

If you have arrived at this page as a result of running the Server Health report, congratulations you are on the first step to improving your server health.

 

What does this mean to my SQL Server

If you have many queries with cached plans that are taking up lots of space, and have only been used once, this is using up memory that could be used more efficiently.

How Do I Fix It

Use Parameterized Queries

The biggest win for cleaning up big one time use queries is to use Parameterized Queries.  When a query is executed, there are 2 main parts to the query being run.

  1. Parsing the query.  This can be skipped if there is already a matching query found that has been parsed.  Parameterized queries help the already parsed queries to get reused again.
  2. Executing the query.  The step of getting the data and returning the result set.
You can’t get around the second step, but the first step will be skipped if the query has already been parsed.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


6 × = eighteen

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>