Press "Enter" to skip to content

Author: Kevin Feasel

Pulling Random Values from a Gaussian Distribution in T-SQL

Sebastiao Pereira has another way of populating a random variable:

Generating random numbers from a normal distribution is essential for accuracy and realistic modeling. Used for simulation, inference, cryptography, and algorithm design for scientific, engineering, statistical, and AI domains. Is it possible to create random Gaussian numbers in SQL Server using the Ziggurat algorithm without external tools?

I was not familiar with this technique, so it’s neat to see it in action.

Leave a Comment

An Overview of Azure Managed Cassandra’s Architecture

Amy Abel describes an architecture:

I’ve been learning about Azure Managed Cassandra recently, and it’s very different from the usual relational SQL Server database. The documentation and tutorials can seem confusing at first, but once I broke things down it was easier to understand basic concepts.

Read on for a warning about different flavors of Cassandra, as well as how Microsoft has organized things in their implementation of Cassandra.

Leave a Comment

Pandas vs Polars for DataFrame Modification

Russ Hyde compares Pandas and Polars:

In Data Science we are often working with rectangular data structures – databases, spreadsheets, data-frames. Within Python alone, there are multiple ways to work with this type of data, and your choice is constrained by data volume, storage, fluency and so on. For datasets that could readily be held in memory on a single computer, the standard Python tool for rectangling is Pandas, which became an open-source project in 2009. Many other tools now exist though. In particular, the Polars library has become extremely popular in Python over recent years. But when Pandas works, is well-supported, and is the standard tool in your team or your domain, and if you are primarily working with in-memory datasets, is there a value in learning a new data-wrangling tool? Of course there is.

Read on for a demonstration of fairly basic data operations and how they differ in Pandas vs Polars.

Leave a Comment

An Overview of PostgreSQL Internals

Elizabeth Christensen shows some of the ways to view internal information in PostgreSQL:

Postgres has an awesome amount of data collected in its own internal tables. Postgres hackers know all about this  – but software developers and folks working with day to day Postgres tasks often miss out the good stuff.

The Postgres catalog is how Postgres keeps track of itself. Of course, Postgres would do this in a relational database with its own schema. Throughout the years several nice features have been added to the internal tables like psql tools and views that make navigating Postgres’ internal tables even easier.

Today I want to walk through some of the most important Postgres internal data catalog details. What they are, what is in them, and how they might help you understand more about what is happening inside your database.

Click through for an overview of catalog tables and catalog views (similar to SQL Server’s system tables and Dynamic Management Views, respectively).

Leave a Comment

Business Continuity Options in Azure

Aleksey Vitsko enumerates available options:

You may be familiar with high availability (HA) and disaster recovery (DR) features that are available in SQL Server and have experience configuring and managing them. But you have ever heard of or tried Azure high availability or Azure disaster recovery features. How can I learn more about what Azure brings in terms of HA and DR for Azure SQL offerings – including SQL VMs?

Read on for a variety of options depending upon whether you’re using SQL Server on a VM, Azure SQL Database, or Azure SQL Managed Instance.

Leave a Comment

Changing the Border Color of SSMS Grid Results

Greg Low lightens things up a bit:

As soon as I started working with a recent version of SSMS, I realized that I didn’t like how heavy the grid lines were in the output:

I really wanted the data to be the focus, not the lines. They seemed much darker than on the previous versions. Note that this is a personal preference. I can imagine some people preferring them as they now are. Fortunately, though, you can now change the color of the lines. 

Click through to see how.

Leave a Comment

Calculating Exponential Moving Average in T-SQL

Rick Dobson watches the flow:

Exponential moving averages (emas) are a powerful means of detecting changes in time series data. However, if you are new to this task, you may be wondering how to choose from conflicting advice about how to calculate emas. This tip reviews several of the most popular methods for calculating moving averages. Additionally, this tip presents T-SQL code samples with common table expressions and stored procedures for generating emas from an underlying time series dataset.

“Emas don’t just track trends—they reveal momentum in motion.” That’s why they’re favored when recent values matter most—and why this tip focuses on helping you calculate them with precision.

Read on for the formula and a couple of lengthy scripts to generate it.

Leave a Comment

Running Data API Builder in an Azure Container Instance

Jess Pomfret deploys an API:

This is post two in my series about the Data API Builder (dab), the first post, Data API Builder, covers what dab is and how to test it locally against SQL Server in running in a container. This was great for testing, but now we want to start to productionise this, and the first step is to get it running somewhere other than my laptop.

There are several deployment options available, I recommend you review the Microsoft docs here: Deployment guidance for Data API builder.

ACI wouldn’t necessarily be my first choice for, well, much of anything. However, it is cheap and easy, so it has that going for it.

Leave a Comment

pg_statviz 0.8 Released

Jimmy Angelakos announces a new version of the pg_statviz extension:

I’m happy to announce release 0.8 of pg_statviz, the minimalist extension and utility pair for time series analysis and visualization of PostgreSQL internal statistics.

This release adds support for PostgreSQL 18, adapting to significant catalog view changes introduced in this release:

Read on to see what’s new. pg_statviz is a lightweight extension for observing internal PostgreSQL performance data, such as wait stats and I/O time.

Leave a Comment

Exporting Non-Downloadable Power BI Reports

Koen Verbeeck downloads a report:

Yes, you’re reading that right, we’re going to download a report that cannot be downloaded. Well, it cannot be downloaded from the user interface, that is. Suppose you have a report in a Power BI workspace (Pro, PPU, Fabric, it shouldn’t matter), and they’ve lost the original Power BI Desktop file. You try to download the report, but for some reason the GUI doesn’t let you:

Read on for reasons you might not be able to download the report, as well as what you can do if you do have access to the report but the download option is unavailable.

Leave a Comment