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
A narrow bridge directs the route across a small stream

How to Know If Index is Forced on Query? – Interview Question of the Week #246

October 13, 2019
Pinal Dave
SQL Interview Questions and Answers
Query Hint, SQL Index, SQL Performance, SQL Scripts, SQL Server

Question: How to Know If Index is Forced on Query?

Answer: Let me tell you a brief story so you understand the context of the question.

Read More
Two neighboring boats are held in position by separate ropes

How to Use Multiple Hints Together for a Query? – Interview Question of the Week #241

September 8, 2019
Pinal Dave
SQL Interview Questions and Answers
Query Hint, SQL Joins, SQL Scripts, SQL Server

Question: How to Use Multiple Hints Together for a Query?
Answer: Of course, you can use multiple hints for a query. Here is an example of the same.

Read More
Gouache painting of a row of fruit baskets, three covered and clasped and one open vermilion basket of peaches

READPAST Query Hint: Skip Locked Rows in SQL Server

August 31, 2019
Pinal Dave
SQL Tips and Tricks
Query Hint, SQL Lock, SQL Scripts, SQL Transactions

The READPAST query hint makes a read skip rows that another transaction has locked, instead of waiting for them. This post builds a five-seat demo, runs it in two windows and lists the cases where the hint does nothing. It also shows the work queue pattern that pairs READPAST with UPDLOCK.

Read More
Gouache painting of a wooden marble run with three blocked channels and a vermilion marble in the open one

ENABLE_PARALLEL_PLAN_PREFERENCE Limits: Rows Per Thread

August 29, 2019
Pinal Dave
SQL Tips and Tricks
Parallel, Query Hint, SQL CPU, SQL Scripts

The ENABLE_PARALLEL_PLAN_PREFERENCE limits are easy to miss: the hint can’t make every query parallel, and it can’t spread rows evenly over the threads. This post proves three limits from the last actual plan of demo queries, with the rows each thread processed and the reason a plan stays serial.

Read More
Gouache painting of a track splitting into four parallel tracks with a vermilion switch lever set to the wide side

Force a Parallel Plan: ENABLE_PARALLEL_PLAN_PREFERENCE Hint

August 27, 2019
Pinal Dave
SQL Performance
Parallel, Query Hint, SQL CPU, SQL Scripts

To force a parallel plan for one query, add the ENABLE_PARALLEL_PLAN_PREFERENCE hint to its OPTION clause. This post shows why a cheap query stays serial, runs a demo query with and without the hint, proves the difference from the last actual plan, and explains why the hint belongs in a test and not in every query.

Read More
An open garden gate allows passage while sturdy braces keep its frame stable

Does NOLOCK Really Applies No Lock? – Interview Question of the Week #209

January 20, 2019
Pinal Dave
SQL Interview Questions and Answers
Query Hint, Schema, SQL Lock, SQL Scripts, SQL Server

Does NOLOCK really applies no lock? No. NOLOCK takes a Sch-S, or schema stability, lock. Here is a simple script to see it for yourself.

Read More
An unsettled mosaic in its assembly jig is inspected beside a stable finished sample.

SQL SERVER – Applying NOLOCK to Every Single Table in Select Statement – SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

September 3, 2018
Pinal Dave
SQL Performance
Query Hint, SQL Scripts, SQL Server, Transaction Isolation

READ UNCOMMITTED changes session read isolation without adding NOLOCK to every table. A workshop procedure made the distinction useful.

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

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