Categories
SQL

Batching Large Data Changes Using Key Ranges

Handling data modifications to large tables can be tricky. We can end up with long running queries and large transactions. Efficiently handling them comes from batching. Effective batching in general helps us by: In this post we’ll take a look at a key-range approach to solve the issue. With this solution a batch will be […]

Categories
SSIS

Solving Bottlenecks in SSIS Packages

Last time out we started to look at optimising SSIS packages by showing how to identify bottlenecks with a handy script. This time we’re turning insights into action to solve those pain points. The solutions are grouped into 3 areas: Data Flows, as they do a lot of heavy lifting; the Execute SQL task, which can […]

Categories
SSIS

Tuning Data Flow Buffer Sizes to Improve Performance in SSIS

When using data flows in SSIS packages we want the flow to be fast and fluid. Improving performance of the flows will vary in different packages, but one element can consistently help – tuning memory utilisation. In this post we’ll look at tuning the memory utilisation by altering the number of rows passing through the flow concurrently. […]

Categories
SSIS

Solving Sort Transformation Blocking in SSIS

Last time out we discussed blocking transformations, what they are, the impact of them, and touched on how to deal with them. In this post we’re going a step further to tackle one of them head on. Here we’ll demonstrate the impact of blocking caused by the Sort transformation, and look at two options for solving […]

Categories
SSIS

Beware Blocking Transformations in SSIS Data Flows

We have a platter of transformations to use when constructing data flows in SSIS packages. Not all transformations are equal though, and some can catch us out with performance impact as data volumes scale. In this post we’ll look at blocking transformations which can trip us up if we’re not careful with them (or avoid […]

Categories
T-SQL Tuesday

T-SQL Tuesday #181 – The Festive Tech Calendar ft. Query Store

Rounding out T-SQL Tuesday for 2024, Kevin’s invitation brings it together with the Festive Tech Calendar (more on that at the end), and asks us to write about a Microsoft Data Platform announcement that could be considered a gift. For context, this post is targeted at developers or engineers who don’t have the time to dig into SQL Server […]

Categories
SQL

Why Bother Indexing Foreign Key Columns?

Last week I shared a script to identify foreign keys which weren’t indexed. What we didn’t discuss in detail was why it can be important to index these columns. Here we’ll demonstrate the two areas we can see great benefits by introducing the indexes. Query optimisation We’ll start with the typical benefit of indexing – query optimisation. The index […]

Categories
Azure

Reducing Azure Function Spend with Consumption Plans

A consumption based App Service Plan in Azure provides us with a pay-as-you-go model for Function usage. This can help reduce spend from Premium plans where those plans exceed the requirements of the function, for example low volume or intermittent work. Unfortunately you can’t move a Premium plan to Consumption based via the portal. Instead […]

Categories
SQL

A Bit About Trivial Plans

A Trivial plan is created when SQL Server really doesn’t have any choice in how it’s going to execute. Here’s an example from the StackOverflow database with the indexes removed: There really isn’t any choice but a clustered index seek. It’s the only index and its about as effective as we can get given we’re filtering on […]

Categories
SQL

Optimising DISTINCT Clauses using EXISTS

The DISTINCT clause in a query can help us quickly remove duplicates from our results. Sometimes it can be beneficial to stop and ask why. Why do we need to use the clause, why are we receiving duplicates from our data? I see this typically due to a JOIN being used where we don’t really want all of those results. This could […]