Press "Enter" to skip to content

Curated SQL Posts

Query Tuning via Window Function

Rob Farley eliminates a self-join:

Sometimes query tuning involves taking a different approach to a problem. And given that other tuning options might be creating index(es) or redesigning tables – both of which are much more permanent changes to an environment – rewriting a query can often be just right.

Window functions seem to pop up quite often when rewriting queries, and an example around this would be appropriate for this month’s T-SQL Tuesday, hosted by Steve Jones (@way0utwest at X/Twitter).

Read on for the all-too-common scenario and how Rob improves an existing query.

Comments closed

Bursting and Smoothing in Microsoft Fabric

Nikola Ilic ramps up quickly:

Let’s try to break down these concepts and explain them as simple as possible:

Bursting lets you use more power than you purchased (within the specific timeframe)! Smoothing takes care that this power is “under control” within that same timeframe. Easy, right:)? I know, I know, so let’s break this further down…

Read on for some of the nuance behind this.

Comments closed

Network Troubleshooting for Azure Synapse Analytics

Sergio Fonseca continues a series on Azure Synapse Analytics connectivity problems:

In this post I will speak about how to capture a network trace and how to do some basic troubleshooting using Wireshark to investigate connection and disconnection issues, not limited to samples error messages below:

  • An existing connection was forcibly closed by the remote host, The specified network name is no longer available, The semaphore timeout period has expired.
  • Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was – [Pre-Login] initialization=5895; handshake=29;
  • A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 – The semaphore timeout period has expired.)
  • A connection was successfully established with the server, but then an error occurred during the login process
  • Failed to copy to SQL Data Warehouse from blob storage. A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 – An existing connection was forcibly closed by the remote host.) An existing connection was forcibly closed by the remote host
Comments closed

Database Normalization: Abnormal Forms

I draw the logical conclusion: the opposite of normal forms is, of course, abnormal forms:

This video covers a variety of topics, effectively wrapping up the series on normalization. We look at data warehousing, including why the Kimball-style star schema is a really bad design in theory but a perfectly reasonably design in practice. We cover the chimera of “overnormalization” and I throw out a hot take. And we finally slag on denormalization.

Click through for the video.

Comments closed

Tabular Model Calculation Groups and Compatibility Level

Olivier Van Steenlandt sorts out a problem:

While I was writing another data recipe, I ran into an issue. For some reason, the “Create Calculation Group” was not visible / enabled in Tabular Editor.

I tried to create a Calculation Group by right-clicking on the Table Folder –> Create but the option wasn’t available.

I tried an alternative way: going to the Model Section in the Tabular Editor toolbar. But unfortunately, the option to create a new Calculation Group was disabled.

Read on to see how Olivier solved this problem.

Comments closed

Digging into the Microsoft Fabric Pricing Model

Nikola Ilic puts on the green eyeshades:

Microsoft Fabric is finally generally available! Yaaaay! Now, when the dust settles and the initial allure goes away, the most obvious question that one might ask is – how much will Fabric cost me?

Because, yes, it’s cool to have a unified analytics solution and all Fabric’s “weapons” at your disposal, but at the end of the day, looking at the wallet is what matters most:)

So, let’s try to break down all the available options, plus explain some of the concepts that may affect your Fabric workloads in terms of pricing. 

Read on to see what the major considerations are and how much you’ll shell out to use Fabric for real.

Comments closed

A Good Use of LEAD()

Chad Callihan gets the lead out:

Imagine we want to find gaps in post history for users. If a user is posting every day, we’re happy and can assume they’re happy. If they’re only posting once every few weeks, we want to investigate why that is.

Read on to see how you can do this with the LEAD() function.

Comments closed

Last Observation Carried Forward in SQL Server 2022

Barney Lawrence shows off a nice enhancement to T-SQL in SQL Server 2022:

With SQL Server 2022 came a much requested additional feature added from the SQL standards – IGNORE_NULLS. You can probably guess what it does. Drop in IGNORE_NULLS after your function and you can blur the non null values over those gaps giving us results like this:

Read on for the pre-2022 version of the query and what it does, versus the version with IGNORE_NULLS specified. This small flag is extremely helpful in time series statistical analysis and I’m glad it’s in SQL Server now.

Comments closed

Microsoft Fabric Now GA

Ben Jarvis announces the news:

On the 15th November Microsoft announced the general availability of Microsoft Fabric. Having seen Microsoft Fabric develop through our involvement in the private and public preview this is a really exciting announcement and all of us at Adatis are looking forward to seeing how it will fit into the solutions we are deploying to customers. 

It makes sense to announce going GA at Ignite, though I don’t think Fabric is ready for prime time yet. There are still so many gaps in the product, and even though many items are on the roadmap, I wonder if Fabric will get a bad reputation from going GA too early. My analogy is Cyberpunk 2077: when the game came out, it was a buggy mess. Most of the bugs have been fixed now, a couple of years later, but for many people, their everlasting impression of the game is how buggy it was.

Comments closed