This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Clean plates wait on a drying rack beside a stack ready to put away

What is Clean Buffer in DBCC DROPCLEANBUFFERS? – Interview Question of the Week #215

March 3, 2019
Pinal Dave
SQL Interview Questions and Answers
SQL Cache, SQL Memory, SQL Scripts, SQL Server, SQL Server DBCC

What is a clean buffer in DBCC DROPCLEANBUFFERS? No one had asked me this in 20 years, so here is the answer in the simplest words I could find.

Read More
Gouache painting of a greenhouse wall with one clean pane and a vermilion squeegee on the sill

Clear the Plan Cache for a Single Database in SQL Server

January 9, 2019
Pinal Dave
SQL Performance
SQL Cache, SQL Scripts, SQL Server Configuration

To clear the plan cache for one database, use ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE in that database. This post tests it on two small databases, compares it with DBCC FLUSHPROCINDB and with freeing a single plan, and explains why DBCC FREEPROCCACHE is a bad habit.

Read More
Gouache painting of a stack of dusty suitcases with a vermilion strap on the oldest one at the bottom

Find the Oldest Query Plan in the Plan Cache

November 30, 2018
Pinal Dave
SQL Tips and Tricks
SQL Cache, SQL DMV, SQL Scripts

To find the oldest query plan in the plan cache, sort sys.dm_exec_query_stats by creation_time. This post tests the idea on a demo with three procedures, compares the oldest plan with the server start time, and lists what clears the plan cache.

Read More
An ant trail crosses a picnic cloth toward the food

How to Find Queries Using an Index From SQL Server Plan Cache? – Interview Question of the Week #195

October 14, 2018
Pinal Dave
SQL Interview Questions and Answers
SQL Cache, SQL DMV, SQL Index, SQL Scripts, SQL Server

Before I dropped an unused index, my client’s CEO wanted proof. Here is how to find queries using an index from the SQL Server plan cache.

Read More
Gouache painting of a courtyard of leaf-covered squares with one swept clean and a vermilion-handled broom

Clear Procedure Cache for One Database in SQL Server

January 27, 2018
Pinal Dave
SQL Tips and Tricks
SQL Cache, SQL Scripts, SQL Server, SQL Stored Procedure

To clear procedure cache for one database, run ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE inside that database. This post tests it on two demo databases, shows that the other database keeps its plans, and shows how to remove a single plan by its plan handle. It also covers the cost and the lighter alternatives.

Read More
Gouache painting of a leaning stack of paper cups beside a tray holding one vermilion mug

Optimize for Ad Hoc Workloads: When to Turn It On

October 20, 2017
Pinal Dave
SQL Performance
Ad Hoc Query, Execution Plan, SQL Cache, SQL Memory

Optimize for Ad Hoc Workloads shrinks the memory that one-time queries take in the plan cache. This post builds a demo of single-use plans, measures their share of the cache, and shows how to read the result. It also covers the cost of the setting and why parameterized queries are the better fix.

Read More
One empty template compartment sits above its removed guides, while neighboring compartments and finished products remain intact.

SQL SERVER – How to Clear Plan Cache with Database Scoped Configuration?

August 12, 2017
Pinal Dave
SQL Tips and Tricks
Execution Plan, SQL Cache, SQL Scripts, SQL Server, SQL Server Configuration

I can Clear Plan Cache for the current database through database-scoped configuration. I verify the context before considering eviction.

Read More
Previous 1 2 3 4 5 6 7 8 9 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com