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 wheelbarrow with vermilion handles carrying a basket of fruit down an orchard row of pear trees

Multiple Aggregates in One Query: Read the Table Once

June 20, 2020
Pinal Dave
SQL Performance
SQL Index, SQL Performance, SQL Scripts

Multiple aggregates in one query read a table once, where separate subqueries read it again and again. This post measures the logical reads of two subqueries against one SELECT, uses CASE inside SUM for different filters, and shows two cases where the rewrite gains nothing or loses to an index.

Read More
Gouache painting of a picnic blanket held down by grey stones on a meadow, with a small vermilion spot at its center

LPIM Memory Model: Check It With sys.dm_os_sys_info

June 19, 2020
Pinal Dave
SQL Performance
SQL Memory, SQL Server Security, Starting SQL

The LPIM memory model tells you whether SQL Server runs with locked pages. This post reads it from sys.dm_os_sys_info in one query, confirms it with the process memory view and the error log, and explains what each value means.

Read More
Busy loom stations are inspected beside a separate tray of waiting yarn bundles.

SQL SERVER – Queries Waiting for Memory Grant – Performance Tuning

June 18, 2020
Pinal Dave
SQL Performance
SQL Memory, SQL Server

Queries Waiting for memory grants give me evidence to investigate. A customer CTO requested that evidence before approving more RAM.

Read More
strange results

SQL Puzzle – IN and IS NOT NULL – Strange Results

June 17, 2020
Pinal Dave
SQL Puzzle
SQL NULL, SQL Scripts, SQL Server

Today, let us see a very simple puzzle where we are getting strange results when using NOT IN and IS NULL in a T-SQL query.

Read More
Gouache painting of a row of watering cans in a greenhouse with one vermilion can tipped over in a big puddle

User Statistics Report in SSMS: Who Is Connected

June 16, 2020
Pinal Dave
SQL Tips and Tricks
SQL Reports, SQL Server Management Studio, SQL Server Security

The User Statistics report in SSMS shows the users who are connected to a database. This post opens the report, answers the same question with a query over sys.dm_exec_sessions, and finds the one application that holds many sessions.

Read More
Gouache painting of a grey shed beside the water with its door open and a vermilion key in the lock

SSMS Command Line Options: Server, Database and Login

June 15, 2020
Pinal Dave
SQL Tips and Tricks
Command Line, SQL Command, SQL Server Management Studio

SSMS command line options open Management Studio already pointed at a server and a database. This post finds SSMS.exe, lists the switches that SSMS 22 documents in its own usage text, and shows how to turn them into a shortcut without saving a password.

Read More
A fixed rail guides a cart along a winding route despite a shorter path

How to Force Index on a SQL Server Query? – Interview Question of the Week #281

June 14, 2020
Pinal Dave
SQL Interview Questions and Answers
Clustered Index, Query Hint, SQL Index, SQL Scripts, SQL Server

Question: How to Force Index on a SQL Server Query?
Answer: I personally do not like to force an index on any query. Let us learn together.

Read More
Previous 1 … 105 106 107 108 109 110 111 … 843 Next
  • Books
  • Testimonials
  • Privacy Policy

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