Press "Enter" to skip to content

Curated SQL Posts

Fabric Capacity Units and F-SKUs

Paul Turley provides an explanation:

If there’s one concept that trips up nearly everyone moving into Fabric, it’s capacity units — because a CU isn’t what most people assume it is.

It’s compute, not seats.

A Capacity Unit has nothing to do with user counts or license tiers. It measures compute power, consumed in CU seconds as work actually runs. A report rendering, a pipeline moving data, a notebook chewing through a dataframe — all of it draws from the same shared pool of CU seconds on your capacity. Think of it less like a parking pass and more like a utility meter — it just keeps ticking based on what’s actually being computed, no matter who’s asking for it.

Read on for more information around CUs, as well as what F-SKUs provide and when you might want either.

Leave a Comment

Thoughts on the Databricks Lakehouse

Miles Cole writes from inside the company:

The lakehouse architecture introduced a simple but powerful idea: unify the robust data management of the data warehouse with the openness, flexibility, and decoupled storage of the data lake. In principle, a lakehouse can be implemented anywhere, on any object store, with any compute engine that supports open table formats. In this post I want to make the case for why I believe the lakehouse is best realized on the platform that invented the product category in the first place: Databricks.

I’ll make the case with three points:

  1. Robust data management comes standard
  2. Flexibility without the complexity
  3. A track record of innovation

Click through for the argument.

Leave a Comment

The Importance of Testing Backups

Marlon Ribunal lays out a case:

After sharing my thoughts on SQL Server native backups using Ola Hallengren’s Maintenance Solution, Mark Gribler left a comment that caught my attention:

“The proof of a backup is a restore” (apologies to puddings)!!

I had to smile at that one.

By the way, I give Marlon +1 point for getting the aphorism correct. The correct aphorism is “The proof of the pudding is in the eating.” Ponder that while checking those backups.

Leave a Comment

Hash Keys and Synapse Tables

Andy Brownsword explains the importance of selecting an appropriate hash key:

In Synapse SQL Pools, Hash distributions allow us to somewhat control data distribution. Whilst this can deliver performance in the right scenarios, I noted last week that these tables should be monitored to avoid skew.

In this post I want to demonstrate how to identify the skew, and why a different distribution model may be better suited.

One of the key tricks is that your choice of hash key should be approximately unique. There’s no explicit uniqueness constraint, but having a column with high cardinality and relatively little skew leads to a good distribution.

Leave a Comment

Space-Filling Curves to Display Battles over Time

Richard Vale plots historical battles:

I recently learned about an interesting way of reducing the dimension of a data set. I’d like to illustrate it with a data set of about 550 historical battles in the UK, extracted from Wikidata using a SPARQL query. No doubt some readers will have seen this idea before, but it’s new to me and I found it pretty.

The following plot shows the raw data, with a crossed swords symbol for the location of each battle. It’s possible to see some patterns on the plot (for example, it probably wasn’t much fun to live on the borders of mediaeval Wales) but it could be clearer.

Click through to learn about Hilbert curves and how we can use them to map 2D information to a 1D space. I’d love to see the repro code for this, but Richard does explain the technique. H/T R-Bloggers.

Leave a Comment

Getting Visual Basic 6.0 to Run on Windows 11

Randolph West has a hobby:

In 1999 I released my first commercial software product. ShutOff 2000 was a Windows application that could log off or shut down Windows in multiple ways. It was successful enough that a serial number generator was produced by at least two hacker collectives. A badge of honour, really.

So now that I’m retired, I thought I’d go back and look at how different life is from the last release, which was as recent as 2014.

And then I realized I needed to install Visual Basic 6.0 on my 64-bit Windows 11 virtual machine.

This goes about as well as you’d expect, except that, by the end of it, Randolph actually has a working solution.

Leave a Comment

DML in Postgres

Grant Fritchey tries out some syntax:

Once your PostgreSQL tables are built, the next step is putting them to work. This guide walks through the core data operations every PostgreSQL user needs: inserting records with INSERT, retrieving them with SELECT, filtering and combining tables with WHERE and JOIN, and modifying or removing data with UPDATE and DELETE.

You’ll also learn how PostgreSQL handles IDENTITY columns, sequences, aliases, and referential integrity.

Click through for Grant’s notes.

Leave a Comment

AI Functions in the Fabric Warehouse

Koen Verbeeck shows off a few functions:

We are building a data platform using Microsoft Fabric and we are using the warehouse as the main database engine to store our data. We need to process unstructured data coming from various sources, such as logs, free-text fields in user forms, reviews etc. Our team is quite proficient in T-SQL, but the native T-SQL functions we know from SQL Server are limited in their ability to handle the unstructured text. Ideally, we would parse the data using AI tools, but we don’t know how to do this from the warehouse. What are our options?

Click through for the list. Based on Koen’s example, the AI_FIX_GRAMMAR one works about as well as Word’s grammar checker, which means that it does a decent job of fixing spelling but is awful for actual grammar.

Leave a Comment

The Pain of Azure Defender Billing

Steve Jones walks through a painful experience:

I hadn’t done much in the last couple of months on Azure. For some reason, I decided to check my bill. What I found was that there were charges for $35-ish/month. This is within my free credit limit as an MVP, but that seemed high. I have a few serverless dbs and some storage, but I was expecting more of a $15 charge.

Azure billing is probably 85% of what an ideal billing solution would look like. There’s a lot of detail and you can get the bill down to a pretty granular level. But the problem is, like Steve found out here, that it’s really hard to tie back individual line items to specific services in a consistent way. Sometimes it’s because of ancillary costs like networking bandwidth. Sometimes, it’s a problem where you can’t easily see what specific resource is costing you money. Either way, it turns a proper audit of the bill into a bit of an ordeal.

Leave a Comment

Truncating a Terabyte-Sized Table in a SQL Server Availability Group

Josh Darnell performs a test:

Years ago, I read a Q&A about the consequences (in terms of latency, log backups, etc.) of truncating a table with billions of rows in an Availability Group. I even wrote my own A to the Q with some measurements, although there was no AG involved in my test. Anyway, I was recently reminded of all that, and realized that AI might make it a lot easier to just test and see what happens.

Read on to see what Josh figured out.

Leave a Comment