Press "Enter" to skip to content

Curated SQL Posts

Bitmap Indexes and Deadlocks in Oracle

David Fitzjarrell looks at bitmap indexes:

Bitmap indexes can be very useful, especially when NULL columns are present, as a bitmap index will include such values when btree indexes may not, such as entirely null index keys. Unfortunately bitmap indexes do not behave well with concurrent transactions, where deadlocks may arise because of the bitmap index.

Oracle will trap, report and “resolve” deadlocks by assessing the situation, determining which session created the deadlock and killing the ‘offending’ session, with no manual intervention required. The trace file generated reports this as an issue with application coding and/or logic and in many cases this is the likely cause. Enter the bitmap index and a concurrent transaction and, mysteriously, a deadlock may appear, confounding the developer and the DBA.

Read on to learn more about how bitmap indexes can provide a (potentially) strange source of deadlocks.

Comments closed

RAISERROR vs THROW

Andy Brownsword looks at the two ways to bubble up an error in SQL Server:

I don’t use RAISERROR often – I usually forget which severity code to use. After looking at a sprinkling of them recently I decided it was time for a refresher, so come along for the ride.

If you check out the online documentation it states that “New applications should use THROW instead”. It also sounds like its used to raise ‘RROR’s (whatever they are?). Neither are quite the whole story though. Let’s get into it.

My general rule of thumb is that I tend to use THROW most of the time, but RAISERROR in loops so that I can print out how far along in the process something is, as there is no WITH NOWAIT equivalent to THROW. Andy mentions using THROW; without additional parameters, and that’s very helpful when you want to maintain the original error message rather than wrapping your own around it. It’s not quite as useful as a re-throw in a language like C#, where you keep stack trace information, but helps with troubleshooting.

As for not doubling the letter if it is the last letter of the first word and first letter of the second word (raise error or help protect), it was the fashion at the time, like wearing a yellow onion on your belt. I suppose the intent was to prevent typos or make it look slightly better, but I’ve never been a fan.

Comments closed

Prereqs for using Power BI’s Analyze in Excel Capability

Nicky van Vroenhoven lays out the rules:

I think I now got this question 4 times in the last months, so I thought I’d write it down so I can reference it later, and point people to it

What are the requirements so (a group of) colleagues can start using Analyze in Excel?

Good question, let me break it down. 
In general, I think it’s also better to use Analyze in Excel than Export to Excel!
Reza Rad also wrote about why that’s important earlier.

Click through for the list of prerequisites and a few things to keep in mind.

Comments closed

Cross-Validation and Time Series Data

Vlad Johnson takes us through a technique to test time series results:

Time series modeling, compared to traditional nontemporal modeling, presents unique challenges in ensuring that models generalize well to future, unseen data. One key methodology to address these challenges is cross-validation.

Time series data inherently contains temporal dependencies — observations are ordered in time, and future values may depend on past trends. This structure makes it challenging to estimate how well a model will perform on new, unseen data.

Click through for an explanation of cross-validation, why this becomes challenging when you have time series data (or other serially correlated data), and tips to resolve this challenge.

Comments closed

Skewed Data and Skewed Parallelism

Erik Darling has a new slide deck. This video focuses on how skewed data can potentially lead to parallelism not distributing the data on different CPU threads effectively. Erik demonstrates how you can identify this issue in practice, though solving the problem will come in a later video. It’s an interesting scenario and stick around for a poke at an argument Pedro Lopes has made.

Comments closed

Natural Language Querying in SQL Server

Hadi Fadlallah shells out to an API:

Data is usually the most important asset in organizations, but only SQL developers can frequently access that data. Technical teams often write queries for non-technical users. This restricts agility, slows decision-making, and creates a bottleneck in data accessibility. One possible remedy is natural language processing (NLP), which enables users to ask questions in simple English and receive answers without knowing any code. Still, the majority of NLP-to-SQL solutions are cloud-based, which raises issues with cost and privacy.

This particular solution has nothing to do with the embedding features in SQL Server 2025. Instead, it essentially shells out to an Ollama API and runs the resulting SQL query. It’s reasonably neat but I’d have so many qualms putting anything like this into production.

Comments closed

Microsoft Fabric Extension for VS Code now GA

Sunitha Muthukrishna announces an update to an extension:

Manage Fabric items programmatically: Use item definitions to unlock scripting and work with your items as files. You can update and deploy Fabric items to existing workspaces or new workspaces directly from VS Code—saving you time and effort. Fabric items, that have Item definitions API support, support this capability.

Read on to see what else made the cut.

Comments closed

Dynamic Landing Pages for Embedded Power Apps

Jon Vöge has one landing page to rule them all:

In either scenario, we would of course like to solve this using 1 app with multiple screens, and dynamically open up different screens depending on a parameter.

We would not want to develop two almost identical apps, with governance on each app, just to be able to present different landing pages for each scenario.

So how do you do it? Read on below for the answer…

Click through for the scenario depictions as well as the answer.

Comments closed

Tracking when Workspace Monitoring Throttles Power BI Queries

Chris Webb wants to know if Workspace Monitoring is throttling any Power BI queries in Microsoft Fabric:

A lot of new documentation was published recently around Fabric capacities, including documentation on how to size and govern capacities and how to troubleshoot problems with capacities. The latter has instructions on how to use the Capacity Metrics App to determine if your Power BI queries are being throttled; it mentions that you can also determine if queries have been throttled using Workspace Monitoring or Log Analytics but doesn’t go into details about how, something I will address in this post.

Read on to learn more.

Comments closed