Press "Enter" to skip to content

Curated SQL Posts

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

T-SQL Tuesday 202 Round-Up

Marlon Ribunal summarizes a group of outages:

I expected stories about bad queries, failed deployments, storage problems, or maybe a database that decided to have a very bad day. What I got was much more interesting.

There were stories about ransomware, corrupted databases, deleted storage, power and cooling failures, an identity column reaching its limit, and even a floppy disk. A server Meltdown too.

Some of these outages lasted hours. Others lasted days or even weeks.

Click through for the list.

Leave a Comment

Tracking Online Index Rebuild Progress

Rich Benner doesn’t take 0% for an answer:

Ever had a situation where you’re rebuilding a large index but when you check sp_whoisactive, you see 0% complete … and you know the system is just lying to you?

We recently had a scenario where we were rebuilding a large index for a customer over a long weekend. We were monitoring closely, as this has caused production issues in the past. After 2.5 hours, we did not see any progress on the rebuild.

Read on to see what you can use to estimate the progress.

Leave a Comment

Tracking Changes in Power BI Semantic Models

Chris Webb wants to know what changed:

Here’s a situation I’ve found myself in many times. You’re called to help someone whose Power BI report is suddenly very slow. You ask whether any changes were made to the semantic model around the time performance got worse and the answer is no, absolutely not. You then spend anything from a few hours to a few days trying to fix the problem and when you find it, it turns out that someone did make a ‘minor’ change to the semantic model after all and this was the cause of it all. Wouldn’t it be good if you could see when things like measures were last changed? Well you can.

Click through to see how, as well as some challenges you might run into along the way.

Leave a Comment

Building an Azure DevOps Extension for Microsoft Fabric

Kevin Chant gives us the rundown:

When I first released the extension, I decided to keep the source code private. Having invested significant time developing and testing it, I wanted to first establish the extension.

Now that the source code is available in a GitHub repository I decided to share my experiences to help others create their own Azure DevOps extensions. Because there is more to creating an extension then just modifying the source code.

Click through for Kevin’s lessons learned.

Leave a Comment

Taking T-SQL Snapshot Backups on AG Secondaries

Andrew Pruski takes a backup:

One of my favourite features of SQL Server 2022 was the T-SQL Snapshot Backups. The ability to leverage the snapshot capabilities of modern storage arrays to take application consistent snapshots of our databases is a game changer for anyone dealing with very large databases and struggling to hit their RPO within their RTO.

However, application consistent snapshots require the write IO of the database to be quiesced/frozen/stunned…and (rightly so) this can make DBAs nervous.

SQL Server 2025 introduced the ability to take full and differential backups of secondary replica databases in availability groups…but what about the T-SQL Snapshot Backups? Wouldn’t it be great if we could take those on the secondary and not have to stun IO on the primary database?

But Andrew didn’t stop there, so click through to see how you can do it.

Leave a Comment