Press "Enter" to skip to content

Curated SQL Posts

Incremental Liquid Clustering in Apache Spark

Miles Cole lays out a recommendation:

Liquid Clustering was already a better abstraction than static partitioning due to its flexible nature. Fabric Spark Runtime 2.0 fixes the part that had me actively cautioning customers to reconsider blindly adopting it: the cost of maintaining the layout.

In Runtime 1.3 (Delta 3.2) a small append followed by OPTIMIZE would rewrite every file in a partial Z-Cube. In Runtime 2.0, the incremental strategy only touches files that are unclustered, small, or carrying a high density of deletion vectors. That changes Liquid Clustering from an occasional, potentially expensive maintenance operation into something that works beautifully with workloads of any shape and with adjacent layout optimizations. Batch or streaming writes. Auto Compaction and/or Fast Optimize. With the new incremental strategy, Liquid Clustering is highly compatible and highly efficient, and should now take its rightful place as the de facto new data layout strategy.

Read on to learn more about what Liquid Clustering is, how it works, and why you should think about it if you’re using Fabric Spark Runtime 2.0.

Leave a Comment

The Power of PBIP

Ruben Van de Voorde lays out an argument:

The PBIP format is an alternative to PBIX for storing the metadata that defines your semantic model and report. It allows more robust workflows and is far more agent-friendly, while the PBIX binary format packs everything into one file.

In this article, we argue that you should use PBIP format by default, deferring to the PBIX format only when PBIP isn’t an option.

Like when you’re using Power BI Report Server because then you’re not allowed to have nice things.

Leave a Comment

Partition Switching and Archive Tables

Aaron Bertrand shares some thoughts:

Something I’ve been thinking about lately is how much work I force onto SQL Server simply because data gets old. An order processing system may need to keep data for three years for warranty reasons or seven years for compliance reasons, but that doesn’t mean that data has to live all those years in your hottest, most active table and database. It also doesn’t mean you should spend a lot of effort moving it, row by row, to an archive table, never mind a completely different database. Only to delete it later. If you’re constantly fighting archiving processes that interfere with everyday workload, this conversation might be for you.

Click through for the article. One additional thing I could recommend looking into is using something like PolyBase for that archival. I have a demonstration of the process and it essentially uses the same technique SQL Server professionals used prior to partitioning in 2005. That particular scenario would work best when the archival data is stuff you very rarely query, but can allow you to move data off of relatively expensive fast storage onto relatively less expensive and slower storage.

Leave a Comment

Retrieving Plans from DMVs and Query Store

Deborah Melkin concludes a video series on how to get execution plans in SQL Server:

I really wanted to put this together because I feel like understanding these differences is important to understanding how we can troubleshoot performance problems and where we need to be looking for these pieces of information to get that full picture of where to spend our time. It makes us better performance tuners. I hope you found this helpful and you leave with a better appreciation for these nuances.

Click through for the video, as well as a transcription on the blog post.

Leave a Comment

Test and Validate Azure SQL Database Migrations

Marlon Ribunal has a tool:

Introducing azsql-migration-test, a small open-source CLI that validates your Azure SQL Database migrations against a local Azure SQL Database Developer container — the same engine as the cloud, running on your machine.

The problem: proving a migration works shouldn’t require the cloud

The tool is AI-generated and it looks like the blog post is as well, but it does look to be useful.

Leave a Comment

Improving Power BI Performance

James Serra has updated a guide on Power BI performance optimizations:

This post is a complete replacement for and update to my April 2022 post, Power BI Performance Features. That post focused on several performance features that were new or in preview at the time. Four years later, many of those features have matured, Microsoft Fabric has changed the architecture choices available to us, and Direct Lake has become an important part of the conversation. So rather than keep adding notes to an old feature list, I decided to step back and answer the more useful question: How should you design, diagnose, and improve Power BI performance today?

Here’s the bottom line: Power BI performance is not one feature, one setting, or one capacity size. It is the result of a chain that includes the data source, data preparation, storage mode, semantic model, DAX, report design, security, refresh process, and Fabric capacity. A weakness anywhere in that chain can become the bottleneck, which is why randomly changing DAX or buying more capacity often does not solve the real problem. The best approach is to make the right architectural choices first, measure what is slow, and then fix the layer that is actually causing the delay. For more info, see Optimization guide for Power BI.

Click through for James’s guidance.

Leave a Comment

Azure SQL Developer

Carlos Robles and Vandana Mahtani make an announcement:

Big news: Azure SQL Developer is here, in private preview. It’s the Azure SQL Database engine, on your laptop, in a container. Build against the exact engine you run in the cloud. Ship the same code to Azure. Change one line, the connection string, and you’re in production. Free for local dev and CI. No subscription. No credit card. No catch. Run it yourself, or hand it to an AI agent and watch it go. 

That’s pretty neat, especially because there is a surface area difference between Azure SQL Database and SQL Server.

Leave a Comment

Looping Databases on an Azure SQL Instance

Jess Pomfret has a script:

In the on-prem world, or when we’re working with SQL Servers on VMs, wherever they might live it was pretty easy with dbatools to run a query against all the databases, collect some info and collate it into one record set. This used to work with Azure SQL Instances too – but Azure auth, or cloud auth in general is hard and recently the Connect-DbaInstance command needed to change to make it more reliable.

So, this is a quick post to cover how we can still manage this.

Click through to see how.

Leave a Comment

Inbound Network Protection Feature Gaps in Microsoft Fabric

Meagan Longoria tells a cautionary tale:

Fabric’s inbound network protection gives you two tenant-level controls: Private Link, which routes traffic through your virtual network instead of the public internet, and Block Public Internet Access, which closes the public internet off entirely once Private Link is in place. Together they look like the obvious move if you’re trying to get a data platform off the public internet. Flip two settings, close off the internet, ship a more secure platform. That’s the pitch.

But read on to learn the downside cost to this: you’re giving up quite a bit of capability.

Leave a Comment