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 hand tying one ribbon to each blackberry bush along a lane that has at least one ripe berry.

EXISTS vs IN vs JOIN: Writing Semi-Joins

June 1, 2024
Pinal Dave
SQL Performance
SQL Joins, SQL NULL, SQL Server, SQL Sub Query

Compare EXISTS, IN, and JOIN for semi-joins, prevent duplicate customer rows, and handle NULL safely in exclusion queries.

Read More
Five wooden trugs of carrots sorted by length at the end of a vegetable bed, heaped to different heights.

Histogram Buckets in T-SQL: Counting Values per Range

October 12, 2023
Pinal Dave
SQL Tips and Tricks
Data Visualization, SQL Joins, SQL Scripts, SQL Server

Create histogram buckets in T-SQL with fixed widths or explicit ranges, retain empty buckets, and display scaled text bars.

Read More
Modern Explicit JOIN.

SQL SERVER – Modern Explicit JOIN Syntax – A Brief Note

September 22, 2023
Pinal Dave
SQL Tips and Tricks
SQL Joins

Over time, SQL has evolved and offers two distinct styles for performing JOIN operations: the old-style comma-separated join and the more modern explicit JOIN syntax.

Read More
Parent-Child Queries

SQL SERVER – Making Recursive Parent-Child Queries Efficient

August 14, 2023
Pinal Dave
SQL Performance
Contest, SQL Joins

One puzzle is finding out how many employees each manager is responsible for in a company. Let us Make Recursive Parent-Child Queries Efficient.

Read More
Avoid Join Hints

Avoid Join Hints – SQL in Sixty Seconds #172

June 8, 2021
Pinal Dave
SQL Video
Execution Plan, SQL in Sixty Seconds, SQL Joins, SQL Server

Question: If they can change the join hints to improve the performance of the query. Well, the reality is that I always Avoid Join Hints.

Read More
Gouache painting of a pale wooden bench in a bare room with a single vermilion peg set in the top

Change Join Type for a Query: HASH, LOOP and MERGE Hints

April 22, 2021
Pinal Dave
SQL Tips and Tricks
Execution Plan, Query Hint, SQL Joins, SQL Scripts

To change join type for a query, add one of three hints to its OPTION clause. This post runs one join with each hint on two filters and compares the join type and the logical reads. It shows that no join type is best in general, and what a join hint in the FROM clause does to the join order.

Read More
Gouache painting of a narrow water channel with a vermilion board across it and water flowing past

Disable Adaptive Join for One Query or a Whole Database

March 30, 2021
Pinal Dave
SQL Performance
Execution Plan, SQL Joins, SQL Scripts, SQL Server

To disable adaptive join for one query, add a USE HINT to it. This post also shows a Query Store hint for code you cannot edit and the database setting that switches the feature off for everything. Each switch is tested on a small demo database and checked in the plan.

Read More
1 2 3 4 … 21 Next
  • Books
  • Testimonials
  • Privacy Policy

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