Press "Enter" to skip to content

Curated SQL Posts

Choosing a Chunking Strategy for RAG Applications

Bala Priya C puts together a decision tree:

In this article, you will learn how to choose the right chunking strategy for a retrieval-augmented generation system by working through a structured decision tree tied to the properties of your documents and retrieval task.

Topics we will cover include:

  • What each major chunking strategy assumes about your documents, and when those assumptions hold.
  • A six-question decision tree that maps concrete document and retrieval conditions to specific chunking strategies.
  • The failure signals that indicate a chosen strategy is not working, and the fixes that tend to resolve them.

Click through for the list of strategies and when to include each.

Leave a Comment

Using a Continuous Axis for Date Tables in Power BI

Marco Russo and Alberto Ferrari gussy up a visual:

In a previous article, Creating a simpler and chart-friendly Date table in Power BI, we showed you how to create a Date table you can use in a line chart with a continuous X-axis instead of a categorical one, even when the granularity is the month rather than the day. That technique stores every level as a DateTime column and relies on custom format strings to display the month name.

The auto date/time feature in Power BI provides the same user experience using a different technique. Its hidden date table uses text columns for quarters and months, sorted by a numeric column. However, the line chart still offers a continuous X-axis when you drill down to the month level. We keep saying that auto date/time is not a best practice, but this behavior is useful. Can we obtain it with our own Date table? Yes, we can.

If you have a Date table in your model (as you should!), this article explains how to enable the continuous X-axis in your report when the user groups dates by year, quarter, month, or week.

Click through to see how it looks, as well as how it works.

Leave a Comment

Load Testing Azure SQL Database (Again)

Reitse Eskens is back in the fight:

When I started hammering Azure SQL again, I had a set of scripts to run and tried to figure out what was happening. For most databases, I could explain the results, but some didn’t make sense. I’ll get back to that later in this series.

A few years ago, I did a similar performance-testing series, where I created the data on the database itself using SqlStress to run a massive load of queries and see what happened. This gave a lot of interesting results, most of which are still valid, but I wanted to try something different.

After a look at some Standard SKUs, Reitse moves up to Business Critical:

My previous post on load testing Azure SQL covered the Standard Edition; today I’m moving to the Premium Edition, which is Business Critical in DTU shape.

Again, the calculation mixes CPU, Memory, and disk I/O. The main difference between Standard and Premium is cost. Premium is more expensive and aimed at mission-critical workloads. It has faster storage and built-in replication options. It also includes redundancy, with features designed to keep your solution online.

There are some interesting cutoff points in the tests that make a low-end P-SKU cheaper and just as good as a higher-end S-SKU.

Leave a Comment

Interpreting the Azure Landing Zone as a DBA

Jordan Boich reviews an architecture:

VNet, subnet, NSG and UDR are four key acronyms that exist between me and my DR replica. The first time I started peering into the network world, trying to figure out the nuance how Azure networking impacts SQL Server was a confusing experience. Honestly, I didn’t know what the heck I was looking at. I found through this project, however, that success lies in the foundation. And, setting up that foundation makes all of the downstream processes much easier. This post is going to cover setting up that foundation in Azure. The empty network will harness all of our future objects.

Read on for an extended analogy that helps explain the key networking concepts in Azure.

Leave a Comment

Version Store Accrual and Open Database Transactions

Erik Darling has a video for us:

Erik Darling here with Darling Data and in today’s video we are going to talk about why the version store won’t clear if any database has open transactions. I realized that I read it a little bit differently than it looks there because I had to say it is what we’re talking about where this asks a question, right, so the words don’t precisely line up. But don’t blame the robots for that. That looks weird in the transcript. Anyway, it sounded weird in my head as I was trying to phrase it because I’m looking at the words and trying to rearrange them. That was tough. I’m not as sharp as I used to be.

It’s okay, Erik; none of us are.

Leave a Comment

Entry Points and Graph Neighborhoods with DiskANN

Mala Mahadevan tries something out:

I was experimenting with vector search in SQL Server 2025 using approximately 3.8 million Hacker News articles that that I used for my talk on SQL Server-based vector search feature at EightKB. I generated two sets of embeddings from the same articles: one stored as FP32 (32-bit floating point) and the other as FP16 (16-bit floating point). Both sets contained the same articles and used DiskANN vector indexes.I used a query as below to find articles similar to a selected example.

What Mala found was that FP16 queries could sometimes take longer and require more reads than FP32 queries, which doesn’t make sense on its face. Click through to see two experiments she devised to come up with the answer.

Leave a Comment

Clock Changes and SQL Server

Dualcore DBA turns back time:

In this post we’ll look at the behaviour of a SQL Server application that needs to deal with events that are logged over the period of a UK clock change where the clocks change from GMT (Greenwich Mean Time) to BST (British Summer Time).

The data itself is in UTC (which is good), but getting from UTC to the user’s local time can be a major challenge, especially in T-SQL. There are application libraries that make this a lot easier, which is why I recommend bouncing this up to the application layer whenever possible.

Leave a Comment

Lessons Learned from Troubleshooting with LLMs

Grant Fritchey spends a weekend:

Grant Fritchey walks through a real troubleshooting saga – using Wine, a shim DLL, a misconfigured registry entry, and a lot of trial and error – to get a BridgeCom Maverick radio’s Windows CPS running on Linux Mint.

Along the way, repeated dead ends revealed a pattern: AI tools stay locked onto whatever direction you last pointed them, and it’s up to you to redirect, request alternatives, and demand measurement over guesswork.

In this article, Grant shares everything he learned from the experience, including 8 key takeaways to help you avoid similar trouble when using AI in the future.

Grant takes us through the story and shares eight tips for better troubleshooting along the way. Oh, and Wine is notoriously finicky, so I can totally get why it’d take a while to sort out the issues Grant had.

Leave a Comment

Auto-Indexing in SQL Server

Brent Ozar unveils a secret:

It’s super simple: the installation file, AutoIndex.sql, creates an Agent job and a series of stored procedures including auto_create_index and auto_drop_index. They watch the index usage and missing index DMVs, log their findings to tables, and trend the data over time in order to figure out which indexes to create, and which ones to prune back because they’re only slowing you down.

And it’s even free!

I enjoy these posts, where Brent goes back to ideas people had 20+ years ago. It really shows how creative the SQL Server development team was back in the day.

Leave a Comment

XACT_ABORT vs TRY_CATCH

Jared Westover explains the difference:

After creating a SQL script and a pull request, a savvy developer left a comment on the PR because they were confused about why I was using both XACT_ABORT and TRY…CATCH. They thought that including both in one script was redundant. That got me thinking: is it true that setting XACT_ABORT ON makes TRY…CATCH redundant?

The most interesting part of this post is the cases in which you would use both in the same script.

Leave a Comment