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
Gouache painting of a wooden coat rack with a single vermilion cap hanging on one peg

Index Design Rules: Ten Don’ts and Where They Break

February 13, 2020
Pinal Dave
SQL Performance
Clustered Index, SQL Index, SQL Scripts, SQL Server

These index design rules came from a client’s list of ten index don’ts, and readers argued with several of them. This post turns the checkable rules into read-only queries on a demo database, and it measures what each rule really costs. The rest are warnings, not laws, and the post says which is which.

Read More
Gouache painting of a beagle sitting beside a wicker picnic basket with a vermilion cloth, looking away

DISABLE_PARAMETER_SNIFFING Hint: Turn Off Sniffing for One Query

February 12, 2020
Pinal Dave
SQL Performance
Execution Plan, Parameter Sniffing, Query Hint, SQL Scripts, SQL Stored Procedure

The DISABLE_PARAMETER_SNIFFING hint makes one query ignore the parameter value it was first compiled for. This post compares it with the default, OPTIMIZE FOR UNKNOWN and RECOMPILE on a table where one customer owns 40 percent of the rows. The reads show which variant fits which workload.

Read More
Gouache painting of three fresh rolls in a vermilion basket on a counter in front of a tray of dough still waiting

OPTION FAST N: First Rows Sooner, Total Reads Higher

February 11, 2020
Pinal Dave
SQL Performance
Execution Plan, Query Hint, SQL Scripts, SQL Server

OPTION FAST N tells SQL Server to plan for the first N rows, so the first rows arrive in milliseconds and the whole result costs much more. This post measures both sides on 300,000 rows with logical reads and time to the first row. It also explains why the hint belongs to paging and not to tuning.

Read More
A new adjustable clamp aligns boards while an old clamp rests unused

What is the Replacement of DBCC DBREINDEX? – Interview Question of the Week #263

February 9, 2020
Pinal Dave
Personal
Maintenance Plan, SQL Index, SQL Scripts, SQL Server, SQL Server DBCC

Question: What is the Replacement of DBCC DBREINDEX?

Answer: The answer to this question is very simple.

Here is the syntax:

Read More
Gouache painting of a basket of red apples under an apple tree in an orchard row

DISABLE_OPTIMIZER_ROWGOAL: How a Row Goal Changes the Plan

February 7, 2020
Pinal Dave
SQL Performance
Execution Plan, Query Hint, SQL Scripts, SQL Server

DISABLE_OPTIMIZER_ROWGOAL switches off a row goal, the optimizer’s bet that a query needs only a few rows, and TOP, FAST, IN and EXISTS all place that bet. This post reads the estimates behind it, shows how the plan shape changes, and shows when the bet fails. A covering index fixes the failure, and the hint does not.

Read More
Gouache painting of a cello, a violin and a harp with a small music stand and a single vermilion tuning fork between them

Dynamics SQL Server Settings: Five Checks for NAV, AX and CRM

February 5, 2020
Pinal Dave
SQL Performance
MAXDOP, SQL Index, SQL Scripts, SQL Statistics, SQL TempDB

Dynamics SQL Server settings decide most of the speed you get from NAV, AX and CRM, because you rarely control the application code. Five read-only checks cover tempdb, autogrowth, MAXDOP, automatic statistics and statistics age. Each one comes with a short query and a clear rule.

Read More
Gouache painting of a garden bed with many small seedlings and a wicker basket holding pulled ones

DROP STATISTICS Script: Remove Auto-Created Statistics

February 4, 2020
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Scripts, SQL Statistics, SQL System Table

A DROP STATISTICS script can remove every auto-created statistic in a database, and SQL Server builds the useful ones again on demand. This post previews the statements, runs them behind a switch and shows what happens to the next query. It also says when the cleanup helps.

Read More
Previous 1 … 47 48 49 50 51 52 53 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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