Press "Enter" to skip to content

Day: December 8, 2020

Switching Between Dates with Calculation Groups

Alberto Ferrari has another good use for calculation groups:

This technique works just fine; it has the disadvantage of creating many measures, one for each combination of relationship to activate and base measure. Another solution is to create a calculation group that changes the active relationship of the selected measure. Doing this, you create one calculation item for each relationship and the user chooses the relationship to activate using a slicer or a report filter.

But read on for the calculation group solution, which is a clever way of deferring which relationship you care about until the user selects it.

Comments closed

Execution Plans: Foreign Keys and Deletion

Hugo Kornelis continues a series on execution plans:

In the previous part, we looked at foreign key checking when data is inserted. Inserts in the referencing (child) table can, by definition, not cause foreign key violations, so no checking is done in those cases. But for inserts in the referenced (parent) table, SQL Server needs to check that the inserted value does indeed exist. We saw how both the Nested Loops and the Merge Join operators have some specific optimizations to do that check as efficient as possible; we also saw how the Assert operator does the actual checking.

When deleting data, the reverse is true. We can delete rows from the child table without verification, but deletes from the parent table are subject to a check.

And those deletes can get crazy expensive.

Comments closed

Powershell Splatting vs Backticks

John McCormack on backticks:

My code was full of backticks. You could say I was daft about backticks. I loved them and thought they made my PowerShell code readable because they stopped the lines from running off the monitor. Someone asked me why I don’t use PowerShell splatting? “Whatting” I asked? I had never heard of splatting.

Click through to learn more.

Comments closed

Provisioning Storage for Azure SQL Edge

Andrew Pruski continues a series on running Azure SQL Edge on a cluster of Raspberry Pis:

In a previous post we went through how to setup a Kubernetes cluster on Raspberry Pis and then deploy Azure SQL Edge to it.

In this post I want to go through how to configure a NFS server so that we can use that to provision persistent volumes in the Kubernetes cluster.

There are a fair number of steps, but Andrew does a good job taking us through them.

Comments closed

Sampling the Population of SQL Server Instances

Brent Ozar has a breakdown of SQL Server adoption by version:

Ever wonder how fast people are adopting new versions of SQL Server, or what’s “normal” out there for SQL Server adoption rates, hardware sizes, or numbers of databases? Let’s find out in the summer 2020 version of our SQL ConstantCare® population report.

Out of the 3,650 servers sending in data recently, the most popular version of SQL Server is still 2016. 

It’s an interesting survey, but it’s important to remember with any survey what the biases are before drawing conclusions on the general population of all SQL Server instances. This is among ConstantCare users, so if I had a hunch about them, I’d say they’re going to blow out the middle versus gen pop—in other words, I’d expect 2019 and 2017 usage to be a bit higher across the world (and not just among ConstantCare users), but also 2005 (not pictured), 2008, and 2008 R2 to be higher. My hunch here is that the former are shops which have their act together and figure that they don’t need ConstantCare, and the latter are all of those “hidden” instances of SQL Server acting as the back end for small business websites and the like, where nobody even thinks about having a database administrator, much less paying for tooling. Nonetheless, these are interesting trends and even if I think the general population might look different, my data-less guess is that these numbers look reasonable.

Comments closed