Press "Enter" to skip to content

Month: September 2024

Parsing SQL Server Query Stats in Powershell

Andy Levy builds a cmdlet:

A couple weeks ago, DrData asked

With SET STATISTICS IO ON, is there really no way to show the TOTALS at the bottom? There are some nice tools like StatisticsParser but it sure would be nice to see the totals of all values right at the bottom, especially when there are many tables.

The task at hand in the office was a need to do the same thing, but with SET STATISTICS TIME ON. So I got to thinking…I can PowerShell my way through this, right?

Andy, being The Man, shows us exactly how to do this.

Comments closed

Parameter Sensitive Plan Optimization and Memory Grant Feedback

Deborah Melkin has a video for us:

I’m doing something new – instead of a full post with lots of text, I’m doing a video! While it’s not as polished as others in the community, I didn’t want making it perfect get in the way of getting this done. I’m hoping to do more of these so I will definitely be upping in my game in the production department in the future.

But it’s really the content that I wanted to focus on. It’s a quick look at Parameter Sensitive Plan Optimization and Memory Grant Feedback and what they can do. This is just an introduction to seeing them in action and understanding how we can use that to help tune our queries long term.

Click through for the video.

Comments closed

A Primer on Object-Oriented Python

Leela Prasad has class:

In Python, you define a class by using the class keyword followed by a name and a colon. Then you use .__init__() to declare which attributes each instance of the class should have:

Click through for an introduction to object-orientation as it exists in Python. I have my strong functional programming biases—which is part of why I don’t particularly love Python as a programming language—but if you are going to get comfortable with Python, you’ll get a lot of value out of learning how classes work.

Comments closed

The Importance of Semantic Link

Nikola Ilic excerpts from a forthcoming book:

Since Microsoft Fabric was publicly unveiled in May 2023, there has been an ocean of announcements around this new platform. In full honesty, plenty of those were just a marketing or rebranding of the features and services that already existed before Fabric. Hence, in this ocean of announcements, some features went under the radar, with their true power still somehow hidden behind the glamour of those “noisy neighbors”. 

Semantic Link is probably one of the best examples of these hidden Fabric gems. 

Click through to learn more about Semantic Link and check out Nikola and Ben Weissman’s book as well.

Comments closed

Using SUBSTRING() in PostgreSQL

Rajendra Gupta builds a substring:

The PostgreSQL substring function returns a subset of the input string based on the supplied string starting position and length. You can use the SUBSTRING function for extracting data as per fixed string length and regular expressions.

Syntax:

SUBSTRING (String, Start_Position, length)

Read on for some common uses, as well as cases that are a bit more esoteric.

Comments closed

Documenting Microsoft Fabric Workspaces via Semantic Link Labs

Prathy Kamasani does a bit of documentation:

Documentation is a critical and tedious part of every project. However, it is essential to review existing developments or document new ones. When the Power BI API was initially released, I attempted to do similar things. I wanted to know how to use the API to obtain an inventory of a tenant – Power BI Template – Prathy’s Blog…. Now, I believe I am achieving the same goal but using my current favourite functionality, Fabric Notebooks.

In this blog post, I will discuss using Semantic Link and Semantic Labs to get an overview of workspaces and their contents within specified workspaces via Fabric Notebook. This is just a way of doing it; plenty of blogs discuss various things you could do with Semantic Link. Also, I want to use this to document what I have learned. I like how I can generate a Lakehouse and automatically create Delta Tables as needed.

Click through to learn more about how this works.

Comments closed

pgBackRest and Standby Server Backups

Stefan Fercot does some explaining:

Recently, we’ve received many questions about how to take backups from a standby server using pgBackRest. In this post, I’d like to clarify one of the most frequently asked questions and address a common misconception for new users.

First of all, it’s important to understand that taking a backup exclusively from the standby server is not currently possible. When you trigger a backup from the standby, pgBackRest creates a standby backup that is identical to a backup performed on the primary. It does this by starting/stopping the backup on the primary, copying only files that are replicated from the standby, then copying the remaining few files from the primary.

Read on to learn more and to see an example of how this works.

Comments closed

Security Practices for SQL Server Reporting Services

Scott Murray locks down a service:

What are the various security ramifications when deploying and managing Microsoft SQL Server Reporting Services (SSRS)? What are some of the best practices when setting up security within SSRS?

Read on to learn more about to configure SQL Server Reporting Services in three separate tools: the SQL Server Reporting Server Configuration Manager, SSRS itself, and even SQL Server Management Studio.

Comments closed

Cloud Governance via Azure Policy

Alexey Nazarov draws a line:

Azure Policy is a service that allows you to create, assign, and manage policies that govern your Azure resources. Policies are rules that define the desired state and configuration of your resources, such as the location, size, tags, and properties. Policies can also audit the compliance status of your resources and report any violations.

With Azure Policy, you can ensure that your resources follow the best practices and standards that you define for your organization. You can also use Azure Policy to implement cost management, security, and regulatory compliance for your cloud environment.

Click through to learn more about Azure Policy. My limited experience with it is that the idea is sound, though there are some limitations in what you can do that can make things annoying.

Comments closed

Fun with the Cauchy Distribution

John Cook checks out fat tails:

Someone with no exposure to probability or statistics likely has an intuitive sense that averaging random variables reduces variance, though they wouldn’t state it in those terms. They might, for example, agree that the average of several test grades gives a better assessment of a student than a single test grade. But data from a Cauchy distribution doesn’t behave this way.

This is one of my favorite distributions to mess with, though I’m glad few things naturally follow a Lorentzian. I had a colleague of mine build an Excel spreadsheet to describe the behavior, showing that results never converge and you could easily pull values 50+ “standard deviations” from the “mean.” I use scare quotes there because neither concept actually exists for the distribution, but if you mistake it for an awkwardly thin normal distribution, it can lead to some interesting results.

Comments closed