SQL Window Functions Series: LAG() and LEAD()
Dive deep into the powerful SQL window functions, LAG() and LEAD(). Explore their intricacies, discover real-world examples, and avoid common pitfalls.
2023-12-11
7,099 reads
Dive deep into the powerful SQL window functions, LAG() and LEAD(). Explore their intricacies, discover real-world examples, and avoid common pitfalls.
2023-12-11
7,099 reads
Over the years, SQL Server Statistics have been discussed in countless blog posts, articles, and presentations, and I believe that they will remain a core topic for a while when speaking about performance. Why is that?
2023-10-04
A query is sometimes super fast and sometimes very slow. One of the main reasons for this problem is Parameter Sniffing. There are several approaches to addressing the Parameter Sniffing issue and this article discusses effective methods for handling Parameter Sniffing in SELECT statements containing a TOP clause.
2023-09-18
This is a short look at a technique that I discovered recently in Management Studio (SSMS). The technique is to compare two graphical execution plans in the tool to understand what they are doing and how two different queries might affect a particular system, both with the image and with the properties' data behind the […]
2023-11-24 (first published: 2021-03-30)
9,564 reads
In this article we look at how to interpret and use the results of STATISTICS IO when tuning SQL Server queries.
2021-02-17
There are plenty of experts that look to teach you about query tuning and the internals of query execution in SQL Server.
2020-07-18
159 reads
In this article we look at different use cases for columnstore indexes like when performing SQL Server count * queries.
2020-01-17
As SQL developers, we tend to think of performance tuning in terms of crafting the best table indices, avoiding scalar and table valued functions, and analyzing query plans (among other things). But sometimes going back to the spec and applying some properties of elementary math can be the best way to begin to improve performance of SQL queries which implement mathematical formulas. This article is a case study of how I used this technique to optimize my SQL implementation of the Inverse Simpson Index.
2021-05-07 (first published: 2019-09-12)
5,374 reads
Introduction Instead of going straight into the topic of the Query Store, I would like to start this Stairway Series by mentioning a few performance tuning scenarios that are very common to production DBAs. I think most of us have been in one of these situations at some time: An application experiencing slowness after a […]
2020-10-07 (first published: 2019-05-13)
6,604 reads
The IGNORE_DUP_KEY option for unique indexes specifies how SQL Server responds to an attempt to INSERT duplicate values: It only applies to tables (not views) and only to inserts. Any insert portion of a MERGE statement ignores any IGNORE_DUP_KEY index setting.
2019-04-05
Here’s a way to centralize management, rotate secrets conveniently without downtime, automate synchronization and...
This may or may not be helpful in the long term, but since I’m...
By Steve Jones
“I’m sick of hearing about Red Gate.” The first article in the book has...
Comments posted to this topic are about the item Dynamic T-SQL Script Parameterization Using...
Comments posted to this topic are about the item Pitfalls to avoid while feeding...
Comments posted to this topic are about the item Column Adds and Drops
I run this batch on SQL Server 2022. What happens?
ALTER TABLE dbo.Accounts ADD AccountAccessType INT GO ALTER TABLE dbo.Accounts DROP AccountAccessType GOSee possible answers