Press "Enter" to skip to content

Curated SQL Posts

Data Archival and Retention in PostgreSQL

Daria Nikolaenko walks through a presentation:

I’ve started talking about something that happens with almost every Postgres database — the slow, steady growth of data. Whether it’s logs, events, or transactions — old rows pile up, performance suffers, and managing it all becomes tricky. My talk was focusing on  practical ways to archive, retain, and clean up data in PostgreSQL, without breaking queries or causing downtime.

Read on to learn more.

Leave a Comment

The Basics of Oracle RAC

Kellyn Gorman gives us a primer:

Oracle Real Application Clusters (RAC) is still one of the most robust instance high-availability and scalability solutions, designed to provide resilience, performance, and continuous service for many Oracle enterprise workloads. Whether deployed on two nodes or a complex multi-node setup, RAC ensures your database infrastructure is both fault-tolerant and responsive under increasing demand.  RAC is an essential part of the Maximum Availability Architecture (MAA) recommended practices, (and in my experience) found in about 40% of small to medium Oracle environments, 98% of large enterprise environments and 100% of Exadata engineered systems. 

In this post, we’ll walk through the architectural foundation of RAC, configuration essentials, and a real-world transactional scenario that highlights the importance of its shared and synchronized architecture.

Read on to learn more.

Leave a Comment

New Objects in SQL Server 2025

Brent Ozar does a bit of spelunking:

The first public preview of SQL Server 2025 dropped yesterday, and here’s what’s new under the hood as compared to today’s SQL Server 2022 CU19. Forgive me – this is quite a lengthy post, and it’s mostly a data dump. There are new stored procedures, extended stored procs, views, feature switches, new columns in existing tables, messages, and more.

I suspect that the contents of the new undocumented sys.dm_feature_switches table alone will get y’all really curious because there are 5,910 lines in there (included in this post) that suggest all kinds of wild things Microsoft is currently working on, but hasn’t announced publicly yet.

Read on for the very long list.

Leave a Comment

“Can’t Determine Relationships between the Fields” in Power BI

Marco Russo and Alberto Ferrari explain an error:

When you create a Power BI matrix, you drag and drop columns in the matrix, then add some measures, and Power BI figures out on its own which combinations of values to show. The process is so intuitive that we mostly ignore the details. However, Power BI sometimes cannot figure out how to populate the matrix, thus producing the error: “can’t determine relationship between the fields”. Adding a measure fixes the problem, but why? In some other scenarios, Power BI shows many empty rows, eliminating many of them only when you add a measure. Power BI shows a subset of the values in other scenarios, even when no measure is involved.

Read on for the explanation.

Leave a Comment

Cosmos DB in Microsoft Fabric

Anitha Adusumilli has an announcement:

Building on the momentum from the launch of SQL database in Fabric, we are expanding databases workload in Fabric with this new addition. You can now store semi-structured NoSQL data in Cosmos DB in Fabric, alongside your relational data in SQL databases, enabling a unified data platform for your applications. This further positions Fabric as a complete data platform to handle all your organizational needs, from operational to analytics and BI.

Good news: Microsoft is helping us find the exact limit for the credit cards we’re using to pay for Fabric.

2 Comments

T-SQL Snapshot Backups to FlashArray

Anthony Nocentino cuts out the middleman:

In this post, I’ll walk you through a T-SQL script that creates application-consistent snapshots on Pure Storage FlashArray, all from within SQL Server, no external tooling. SQL Server 2025 introduces a powerful new feature: the sp_invoke_external_rest_endpoint stored procedure. This enhancement makes calling REST APIs directly from T-SQL easier than ever. Combining this new capability with Pure Storage’s API allows us to orchestrate snapshot operations seamlessly, with no external tools or scripts required.

Click through for the process. I know that sp_invoke_external_rest_endpoint will be controversial for DBAs. That’s why I think it’s good to have examples of how it can be useful before the knee-jerk reaction of “this is automatically bad” takes over.

Leave a Comment

Local Vector Search in SQL Server 2025

Andy Yun gives vector search a try:

With the announcement of SQL Server 2025 Public Preview, hopefully you are interested in test driving Vector Search.

Microsoft has already posted demo code, but it’s only for OpenAI on Azure. But many of us are wondering about running things locally. So I thought I’d share a step-by-step of getting Ollama setup and running locally on my laptop. End-to-end, these instructions should take less than 30 minutes to complete.

Andy’s process involves downloading and running an embedding model to generate the vectors, creating an external model pointing to Ollama, and using it to generate embeddings.

Leave a Comment

JSON Indexes in SQL Server 2025 CTP 2.0

Daniel Hutmacher gives it a try:

Starting today, the public preview of SQL Server 2025 is available to download!

One really interesting new feature that got my attention was the addition of JSON indexes. I’m a big fan of everything that makes working with JSON easier, since JSON blobs are so much easier to work with than table variables when you’re moving data from point A to point B. This is especially true when you’re working with complex, relational data.

Daniel lays out some of the limitations of JSON index creation and also some of the performance gains you might see from it. This will be most helpful in data engineering scenarios, shredding JSON from various services, but the normalization purist in me says that if you’re shredding JSON enough to need indexes, it’s probably time to normalize that data.

1 Comment

Running SQL Server 2022 on Ubuntu 24.04

Laerte Junior gives it a go:

Microsoft does not yet support this edition of Ubuntu, but there are some workarounds to make it work. This should not be used for production usage and this blog is for educational/testing purposes only.

For my installation, I am using an AWS EC2 Ubuntu 24.04 with 2 GB of Ram. 2GB of RAM is the minimum required. This guide is targeted towards people who have installed SQL Server on previous versions of Ubuntu.

Laerte got it to work, but honestly, I’d rather wait for official support, especially if you’re stuck installing older versions of security-related packages (libldap vs the libldap2 that exists on Ubuntu 24.04).

Leave a Comment

The Unreliability of Microsoft Fabric

Brent Ozar points out some major issues:

The link https://aka.ms/fabricsupport takes you to a localized status page that almost always shows all green checkmarks – even when the service is on fire. During last month’s 12+hour overnight outage, people were screaming on Reddit overnight that things were down, but the status dashboard was showing all green. When Microsoft employees woke up, they asked if people were still having problems – and then eventually got around to updating the status page to reflect the outage when it was clear that things were really borked.

Redditors have resorted to relying on reporting Fabric outages to Statusgator, who then tracks the time gap between a burst of user outage reports, to the time Microsoft actually updates their status page – and it ain’t pretty:

Click through for Brent’s take and an embarrassingly bad post-mortem. Given that Microsoft Fabric is a software-as-a-service product, there’s an inherent level of trust necessary in using it: you’re relying upon the platform team to ensure things are running smoothly and that you get what you’re paying for. Incidents like this erode that trust. Outages themselves are bad but they do happen. The real problem is in not embracing the outage: be clear with customers on current status and cause, and ensure people can easily see the history of events.

Leave a Comment