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 picket fence with a tiny padlock on every picket beside a gate with one big vermilion padlock

ROWLOCK Hint and Slow Performance in SQL Server

July 26, 2018
Pinal Dave
SQL Performance
Query Hint, SQL Lock, SQL Scripts, SQL Server

A ROWLOCK hint makes SQL Server lock each row it reads instead of whole pages. This post counts the locks of the same scan with and without the hint, times both versions, shows how an open transaction on a busy server changes the result, and explains how ROWLOCK differs from UPDLOCK.

Read More
Gouache painting of an antique sewing machine beside two spools whose threads form a tight vermilion knot

NOLOCK Without WITH: Table Hint or Table Alias?

October 24, 2017
Pinal Dave
SQL Performance
Compatibility Level, Query Hint, SQL Lock, SQL Scripts

NOLOCK without WITH and without parentheses is not a hint, because SQL Server reads it as a table alias. This post proves it with a lock test, shows why the compatibility level doesn’t change it, and gives a query that finds the bad syntax in your code. It ends with the safer ways to write the hint.

Read More
Aligned asparagus stems entering a mechanical peeler beside crossed stems

BULK INSERT ORDER Hint: Loading Pre-Sorted Files Without a Sort

December 7, 2015
Pinal Dave
SQL Tips and Tricks
Query Hint, SQL Order By, SQL Server

The ORDER hint does not sort anything. It is a promise about your file, and SQL Server checks it. Here is what happens when you break it.

Read More
A hand guiding a red shoehorn into the heel of a stiff new leather shoe by a front door.

Plan Guides: Fixing a Query You Cannot Change

October 15, 2015
Pinal Dave
SQL Performance
Execution Plan, Parameter Sniffing, Query Hint, Query Store, SQL Server

Apply plan guides to a parameterized query you cannot edit, validate the guide, confirm plan matching, and compare Query Store hints.

Read More
Gouache painting: two jars of dried beans on a market table, one still full and one with its beans counted into small even piles beside it; one vermilion bean in the full jar

New Cardinality Estimation: What Changed Since 2014

August 19, 2014
Pinal Dave
SQL Performance
Compatibility Level, Execution Plan, Query Hint, SQL Statistics

The new cardinality estimation guesses row counts differently from the old one. This post tests both on SQL Server 2025 with one query, shows three switches that choose the model, and gives a safe way to upgrade.

Read More
Queue barriers with red ropes zigzagging across an empty hall toward a nearby door.

OPTION (FORCE ORDER): When a Join Order Hint Helps and Hurts

October 12, 2013
Pinal Dave
SQL Performance
Execution Plan, Query Hint, Query Store, SQL Joins, SQL Server

Test OPTION (FORCE ORDER) against real join plans, see when fixed table order helps or hurts, and apply a reversible Query Store hint.

Read More
Several hands reaching into a crate of oranges, each taking a different one, one hand passing over a held orange.

UPDLOCK and READPAST for Queue Tables

April 22, 2013
Pinal Dave
SQL Tips and Tricks
Query Hint, SQL Lock, SQL Server, SQL Transactions

UPDLOCK and READPAST let SQL Server queue workers claim different rows safely when transactions, retries, and completion rules are designed.

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

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