Press "Enter" to skip to content

Author: Kevin Feasel

Working with Latch Contention in SQL Server

M A A Mehedi Hasan gets into latches:

As a DBA, you are often vigilant to the common suspects like blocking, deadlocks, or long-running queries. Sometimes, performance issues creep in silently due to latch contention. When it overwhelms, even the most optimized queries may crawl. This article explores what SQL Server latch contention is, how latches differ from locks and how to detect latch issues. Then we will simulate a latch contention scenario and check best practices to minimize its impact on your SQL Server database.

Read on for notes around what latches are and how they differ from locks, why you might get latch contention, and a few ways you might be able to resolve contention issues if you have them. I will say that, in my own experience, latch contention typically wasn’t that big of a deal, in the sense that people make databases slow in other ways long before latch contention becomes the primary issue.

Leave a Comment

Digging into Microsoft Fabric Semantic Views

Eugene Meidinger and Ruben Van de Voorde lay out the purpose of semantic views:

Semantic views are a new type of object you can create in a Fabric lakehouse, where you specify business meaning in YAML. This YAML can identify the tables and relationships as well as contain the DAX for defining metrics. Semantic views are one way Microsoft is implementing the Apache Ossie format, which allows for greater portability for semantic modeling. This represents a shift in how Microsoft has traditionally handled semantic models, which is as self-contained units.

Read on to see what they are, how they work and what it means for Fabric developers.

Leave a Comment

Fuzzy Matching in SQL Server

Warwick Rudd looks at a few functions:

Every organisation I work with has the same customer in its database three times: “Jon Smith”, “John Smith” and “John Smiht”. Regex can tell you whether a value is well formed. It can’t tell you that two values are probably the same thing. That’s the job of fuzzy string matching, and SQL Server 2025 now has it built in.

I will say that I needed to turn on “preview features” for SQL Server 2025 CU11 in a container, though they did announce recently that these functions are GA. It might be a difference in the container versus other installations, or maybe it’ll be totally GA in CU12.

Warwick digs in a bit into the calculations and also points out that this is going to be fairly expensive because of the nature of the comparison. You likely won’t notice on a few thousand rows, but if you have millions of rows, performance will not be great at all.

Leave a Comment

Validating GPS Coordinates in SQL Server

Muhammed Imran prevents errors:

TL;DR: To validate GPS coordinates in SQL Server, stage the raw latitude and longitude as text, check each value’s format and range, log failures with a rejection reason, and only then pass the accepted pairs to geography::Point().

This stops malformed values, such as the word “north”, a blank longitude or a latitude of 95, from breaking your load, and it lets you run distance queries on clean spatial data.

This article follows 12 fictional service locations from raw input to a “within 10 km” search. It also shows the one thing numeric validation can’t catch: a swapped latitude and longitude that passes every check.

Click through for the demo.

Leave a Comment

Using S3 Object Locks for Write-Once Read-Many Storage

James Gallagher takes advantage of immutable storage:

Write Once, Read Many. WORM storage used to mean a physical appliance, usually expensive, usually managed by a vendor, often a pain to integrate with anything. S3 Object Lock gives you the same guarantee natively on objects stored in S3, backed by the same durability story as the rest of S3, and configurable down to individual object retention periods.

It’s one of the more useful compliance features AWS has shipped, and despite it being announced at AWS re:Invent 2018, it is still very much underutilized. Maybe that’s because people don’t quite understand the two modes and when to use each.

Click through for an explanation of how it works, where you can get yourself in trouble, and the benefits you can gain from this. Microsoft is making a push for immutable backups in Azure, and they have similar types of object locks, making this a solid plan for ransomware-proofing your backup strategy, even if your systems are on-premises. Just make sure to do the math on how much it’ll cost you, as any mistakes you make are permanent until the files roll off.

Leave a Comment

The Death of the DBA, Again

Daniel Calbimonte adheres to Betteridge’s Law of Headlines:

So, what is the impact to DBAs?

Here are several questions about how AI could impact the DBA profession:

  • Is the DBA career dead?
  • Is it safe to study a DBA career?
  • Is the cloud affecting the DBA jobs?
  • What can AI do for the DBAs?
  • What is AI unable to do yet?
  • What does the US bureau of labor statistics say about the DBAs and Database architects?

The way I describe things is, what DBAs do today is not a perfect match for what DBAs did 10, 20, or 30 years ago. The specific mechanisms change, the expectations around the role change, and even the tooling and database platforms change. But what doesn’t change is the need for availability, resiliency, disaster recovery, and responsiveness. All of these things are what good database administrators support, whether that’s in SQL Server, Postgres, Databricks, Snowflake, Firebase, or wherever else. What you can control will depend on the underlying platforms, but the big picture is that there are a lot of companies with a lot of data and, as long as access to data retains some amount of business value, there will be room for people to manage where the data gets stored.

“Is the role of DBA dead?” is a different question from “Will I have a job as a DBA?” That answer has a bit more nuance because the opportunity cost of maintaining you (or someone you know) as a DBA.

Leave a Comment

Availability Groups with a Local Service Account

Dualcore DBA doesn’t need your Active Directory trees:

This post is a follow-on from my previous post where we set up a SQL Server Availability Group on a Windows domain. In this post, we’ll run through the process again but this time, our instances will be running under local service accounts and so the process is slightly different. As in the previous post, both instances I will work on are SQL Server 2022 Developer Edition and so benefit from Enterprise Edition features.

Read on to see how the process differs from a scenario with Active Directory.

Leave a Comment

The Importance of Blocking in Databases

Louis Davidson explains why we suffer:

Nope, this is not a clickbait title (ok, well sort of). Blocking is good….otherwise SQL Server (and all the other database platforms would eliminate it for good. And before you say something about a pure MVCC implementation like SQL Server implemented with in-memory OLTP… there is no blocking, but in place of blocking you can do a lot of work, perhaps hours, and when you go to commit, it fails… blocking is better than that in any case where you are doing large transactions.

Read on for the nuance. I fully agree with Louis on this, with the caveat that SQL Server, by default, does too much blocking due to its Read Committed isolation level. A default of Read Committed Snapshot Isolation would have been a good switch about 15 years ago.

2 Comments

An Initial Review of Fabric Apps

Teo Lachev takes a look:

Before diving in, let’s clarify the terminology. Power BI and Fabric have abused the word “app” to cover several very different things:

  • Power BI template app – A packaged solution that a software vendor can distribute through Microsoft AppSource. Customers install it, connect their own data, and use the included semantic models and reports.
  • Power BI workspace app – A way to package and distribute selected workspace content within an organization. For example, Finance can publish reports to users who are not members of its workspace.
  • Power BI organizational app – An evolution of the workspace-app experience that supports creating and distributing multiple apps from content in a workspace.
  • (NEW) Fabric App – A custom-coded web application, typically built with JavaScript/TypeScript and a web framework such as React, that is deployed to Fabric and can use managed APIs, authentication, and data services. “Custom-code app” would be a more revealing name. Unlike a Power BI report, it is an application artifact with its own user experience—even if the result looks suspiciously report-like.

Read on to see what Teo likes about them, the trade-offs you’ll have to make when using them, and some of the limitations in the feature today.

Leave a Comment

Methods to Enable Query Store

Lee Markum has a few:

Query store is a valuable tool for people managing SQL Server, whether that’s on-prem, in an IaaS scenario or AWS RDS, Azure Managed Instance or Azure SQL DB. There are several possible ways to enable the Query Store.

This post will explore some of those methods. If you’re not familiar with Query Store, then go read this post. If you need help getting started with PowerShell, then start here, and that will help the later examples make a bit more sense.

Click through for examples using T-SQL and dbatools.

Leave a Comment