Press "Enter" to skip to content

Curated SQL Posts

NOLOCK Hurts, Even with Indexes

Brent Ozar proves a point:

NOLOCK is bad and you probably shouldn’t use it, but every time I mention that publicly, the pushback just keeps coming. I don’t know why people so firmly believe that their situation couldn’t possibly be affected by bad/random data from NOLOCK.

Today’s misconception comes from a LinkedIn commenter telling me it’s safe to use if you’re doing index seeks. Hoo boy. 

Click through for the proof.

Leave a Comment

CU Consumption after the Query Finishes

Nikola Ilic answers a question:

After my article on Fabric Warehouse CU metering, which caused a lot of people reaching out and mentioning that it helped them understand the topic better, I decided to cover SQL database in Fabric from a similar angle too.

Imagine opening an internal application, updating a few records, and closing it two minutes later. You check consumption afterward and see that compute continued accruing.

Before blaming the application, it helps to understand what keeps the database online, and what Fabric actually measures.

Read on for that answer.

Leave a Comment

Certificate-Based Authentication and Availability Groups

Jordan Boich shares a story:

A few months after a clean migration, replication between the nodes in the global primary AG in a Distributed Availability Group (DAG) just stopped. There were no new deployments, config changes, or specific warning signs prior to this. Windows patching had occurred, the servers rebooted like they usually would, and the AG never came back together.

I know for myself, one of the most frustrating phrases that gives me the sense of impending doom is “nothing changed, why is this breaking?!”. That’s exactly what was going on here.

Read on to see how an innocent-looking configuration setting can cause issues down the road.

Leave a Comment

A Review of SQL Database in Microsoft Fabric

Paul Turley shares some thoughts:

When I first learned that SQL Server databases were coming to Fabric, I wasn’t entirely sure how and why we would use it. Now that I’ve had a chance to use SQL Database in Fabric, I wanted to share some of my experience and thoughts about where and how it makes sense to use it. I thought: Fabric is an analytics platform, and we primarily store data in a Lakehouse or warehouse to prep it up for reporting and analysis with Power BI. Why would I want to store data in a SQL Server database in the Fabric SaaS environment? I’ve since implemented “SQL Database for Fabric” (aka “Fabric SQL Database”) in several projects and I’m just blown away by how fast and simple it is to use. In this post, I will dig into the cost and performance and use cases where this option makes the most sense compared to other hosted implementations of the SQL Server database engine.

Click though to learn more.

Leave a Comment

Tuning DiskANN

Mala Mahadevan wraps up a three-parter on how DiskANN works:

In Part 1, we saw how ‘Vamana’ represents vectors as nodes, connects them with edges, and uses greedy graph traversal to avoid comparing a query against every vector in the dataset. In Part 2, we investigated how PQ gave us compact representations for inexpensive distance calculations, caching kept useful graph nodes close, how SSDs provided capacity, and beam search allowed multiple promising nodes to be expanded together.

In this last part, we will be exploring how we use the parameters to tune DiskANN.

Click through to learn more about these parameters and what they do.

Leave a Comment

Implementing Zero-Trust for a Three-Tier Postgres App

Wellingtone Luvonga puts together some charts:

Implementing a zero-trust network model in Kubernetes requires shifting from the default-allow behavior to explicit, label-driven microsegmentation. This hands-on lab walks through securing a standard three-tier architecture (Frontend ⭢ Backend ⭢ Database) using Kubernetes NetworkPolicies, validating both ingress and egress restrictions.

Click through for the mappings.

Leave a Comment

Source Control for Power BI Semantic Models

Ruben Van de Voorde provides an overview of how source control works with Power BI reports:

Some years ago, our founder Daniel wrote a five-part blog series titled “You’re deploying it wrong!”, which was essentially him shouting that he stole fire from the software gods and handing out torches. He was talking about how software engineers had this wonderful thing called CI/CD, and how it was finally within reach of data people working with Analysis Services. Jokes aside, the core ideas have not changed, but the landscape and toolchain have, so the series deserves an update, and this is it.

Power BI has come a long way in this regard. Unless you’re using Power BI Report Server, in which case, the joke’s on you.

I’m going to return to my Power BI Report Server corner now and not have any of the nice things.

Leave a Comment

Wide Tables and Adding Columns

Richard O’Riordan runs into an oddity:

We have a wide table in MS SQL Server (2019), say 150 columns. We want to add a new bit column at the end of this table with a default value of 0, at first look at this I would have thought, that’s not a big deal, this is a meta-data only change but it wasn’t, the entire table got re-written, so here are some scenarios I tested.

This is quite odd because my recollection is that, with a default constraint, SQL Server shouldn’t need to write anything to the table, and that’s how it’s looked in my testing. Remus Rusanu also had a nice post getting into the details of how this changed for SQL Server 2012. Maybe it’s an oddity from having so many columns on the table or records of a certain width or something?

Leave a Comment