Press "Enter" to skip to content

Author: Kevin Feasel

Defragmenting Power BI Fact Tables

Chris Webb reminds us that Power BI incremental refresh can lead to some fragmentation:

A lot of people are building large datasets in Power BI Premium nowadays, and if you’re building a large dataset you’re very likely to be using Power BI’s incremental refresh functionality with your fact tables or manually creating and refreshing partitions in them. If so, you should occasionally do a special kind of refresh to shrink the dictionaries on your fact tables.

Read on for a test of the most extreme scenario, though even less extreme versions can be bad.

Comments closed

Applying Functions to DataFrames in Pandas

Matt Eland shows off the apply() function in Pandas:

Pandas is a wonderful library for manipulating tabular data with Python. Out of the box Pandas offers many ways of adding, removing, and updating columns and rows, but sometimes you need a bit more power.

In this article we’ll explore the apply function and show how it can be used to run an operation against every row (or column) in your DataFrame – and why you might want to do that.

Read on to see how it works and what additional benefit it provides.

Comments closed

Deleting Data from MySQL

Robert Sheldon burns it all down:

In the last few articles in this series, you learned about three important data manipulation language (DML) statements: SELECT, INSERT, and UPDATE. The statements make it possible to retrieve, add, and modify data in a MySQL database. Another DML statement that is just as important is DELETE, which lets you remove one or more rows from a table, including temporary tables. In this article, I focus exclusively on the DELETE statement to help round out our discussion on the core DML statements in MySQL. Overall, the DELETE statement is fairly basic, but one that’s no less necessary to have in your arsenal of DML tools.

Read on to see how the DELETE statement works and the minor differences from SQL Server.

Comments closed

Monitoring Azure SQL DB Restore Progress

Sudhir Raparia doesn’t have time to wait:

Database Backup & Restore capabilities are crucial for ensuring Business continuity and Disaster recovery. Restore database operation is usually done in critical situations like hardware failure, application errors, ransomware attacks, accidental deletion of database etc., to restore a production database to latest known stable state. In such critical situations users would want to track the progress of restore operation accurately so that they can plan for subsequent actions and/or alternatives.

Currently in Azure SQL DB, you can view the database restore progress either using Portal or using T-SQL as follows:

Click through for information on that DMV, as well as a recent change to it in Azure SQL DB (though not yet Azure SQL Managed Instance).

Comments closed

Troubleshooting I/O Issues in SQL Server

Ajay Dwivedi shares some advice:

Storage performance is something that puzzles a lot of SQL Server professionals. So in this blog, I will cover the basic steps I perform to ensure I get the best performance from the underlying storage.

Read on for some thoughts on storage testing prior to SQL Server installation, as well as what to do to ensure your SQL Server instance is up and at them.

Comments closed

New Query Tuning Book

Grant Fritchey has a book for us:

If you’re interested in getting a digital copy, my brand spanking new book is now available here.

It’s in the intro, but let me tell you a little bit about the new book. It’s really new. Some of the older versions of the book were simply updated, a bunch of changes to most chapters, a couple of new chapters, fixes for old mistakes, ta-da, new book. Not this time. This time, I rewrote it all. From scratch.

Looks like I’ll need to get a copy.

Comments closed

Sending Messages to Event Hub via Python

Kiril Nikolov has a message for us:

Recently I needed to create an Azure Function app that would connect to an API and send data to an Event Hub as part of a real-time data streaming solution.

Azure functions are the perfect connectivity option for a task like this, allowing you to focus on the trigger and the resulting output message you want to capture in the event stream, while Azure handles the maintenance of the cloud infrastructure and hosting to run it.

Azure functions can be written in multiple languages. I needed to write mine in python, meaning that I had to set up a configuration file to connect to the Event Hub (as I will explain in further detail below).

Click through to see how it all works.

Comments closed

AT TIME ZONE Performance and an Alternative

Joe Obbish looks at time zones:

Queries that use the AT TIME ZONE operator may perform worse than desired. For example, Jonathan Kehayias blogged about performance struggles with AT TIME ZONE at sqlskills.com. One key difference between Jonathan’s opinion and my own is that I enjoy writing these kinds of posts.

Read on for the details and check out some work Joe has done around time zone friendly functions as an alternative to AT TIME ZONE.

Comments closed

Properties of Production-Grade Code

David Wiseman has a list:

Security

Production code needs to be secure, following industry best practices. A security incident can cause severe reputational damage and financial impact.

Maintainability

Production code should be maintainable. Avoiding duplication and striving for simplicity.

Read on for a list of properties which production-grade code should have.

Comments closed