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 trail post with three arrow pointers, one of them vermilion

Multiple OPTIMIZE FOR Hints in One Query: Value or UNKNOWN

November 6, 2020
Pinal Dave
SQL Performance
Execution Plan, Parameter Sniffing, Query Hint, SQL Scripts

Multiple OPTIMIZE FOR hints in one query are written as one list: each parameter gets its own value or UNKNOWN. This post compiles the same query six ways, reads the compile values and estimated rows from the plan cache, and shows which combinations SQL Server accepts.

Read More
Distinct tile selection remains separate from a deliberate alignment jig.

SQL SERVER – DISTINCT Does Not Guarantee ORDER BY

November 5, 2020
Pinal Dave
SQL Tips and Tricks
Execution Plan, SQL Operator, SQL Order By, SQL Scripts, SQL Server

DISTINCT removes duplicate result rows without guaranteeing their order. My original claim that it always sorts output was incorrect.

Read More
TOP and DISTINCT

SQL SERVER – TOP and DISTINCT – Epic Confusion – SQL in Sixty Seconds #141

November 4, 2020
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Operator, SQL Performance, SQL Scripts, SQL Server

DBAs from the client’s organization ended up an argument about how T-SQL works. The discussion was about the epic confusion about TOP and DISTINCT.

Read More
Gouache painting of a seedling in a clay pot beside a glass bell jar covering a lit candle

DDL in a Transaction: What Rolls Back and What Blocks

November 3, 2020
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Transactions, Transaction Isolation

DDL in a transaction works in SQL Server: CREATE, ALTER and DROP roll back like any other change. This post proves it with a small demo, lists the statements that are refused inside a transaction, and shows which locks an open DDL transaction holds and who has to wait for them.

Read More
Gouache painting: a long wooden shelf of identical round teapots, each with a plain linen string tied around its handle so they can be told apart, the first teapot left bare and one string dyed vermilion

Uniquifier: The Hidden Cost of Duplicate Clustered Keys

November 2, 2020
Pinal Dave
SQL Performance
Clustered Index, SQL Data Storage, SQL DMV, SQL Index

The uniquifier is a hidden 4-byte value that SQL Server adds to duplicate keys in a non-unique clustered index. This post measures its real cost row by row on SQL Server 2025 and shows it on the page. It also compares it with a unique key you choose yourself.

Read More
A balanced wheelbarrow carries only the needed garden pots while spare pots remain beside it

How to Write Efficient Query? – Interview Question of the Week #300

November 1, 2020
Pinal Dave
SQL Interview Questions and Answers
SQL Milestone, SQL Performance, SQL Server

Question: How to Write Efficient Query?

Answer: There is no right or wrong answer to this question. Let us learn about it today.

Read More
A hand carrying three drinks and a plate on one wooden tray across a cafe terrace, worn gravel paths behind.

Rewriting Correlated Subqueries as Window Functions

October 31, 2020
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Function, SQL Performance, SQL Server, SQL Sub Query

Replace correlated subqueries with windowed counts, dates, and running totals, preserve detail rows, and keep useful EXISTS filters.

Read More
Previous 1 … 85 86 87 88 89 90 91 … 843 Next
  • Books
  • Testimonials
  • Privacy Policy

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