Recently I was working on a project I noticed the many of the packages were using the below pattern to deal with failed lookups. I have seen this in many organisations, whilst this isn’t something new I wanted to write about it as it seems many people are unaware there is a better performing alternative.
What I have found is that when handling failed lookups many people use a pattern which looks like the below:
On initial inspection this may seem like a sensible way to deal with unknown members, it performs the required lookup and enables the calculation of an Unknown key where the lookup fails. However we must remember the Union All transformation is semi-blocking asynchronous transformation (it slows the flow of data as it passes through – see bottom of the post for further information). As such if we use this transformation it will decrease performance of SSIS packages and we should avoid it’s use wherever a better alternative exists.
As it happens there is a very simple alternative to this pattern. We set the lookup to ignore failure, rows where the lookup fails will have a null value.
All rows now flow down the Lookup Match Output with a null value where the lookup failed, the final step is to add a derived column transformation prior to the insert into the target table to replace the null values using a formula as per the below:
The package now looks like this:
When I run both versions of the package with my test data (10,000 rows in which 50% of the lookups fail) it is 30% faster when the Union All transform is avoided. It also creates a simpler flow which is easier to follow. For a full list of the SSIS components categorised into Non-blocking, Semi-blocking and Fully-blocking there is a great blog post on this here: http://sqlblog.com/blogs/jorg_klein/ .
Pareto Charts in Power BI and the DAX behind them
The Pareto principle, commonly referred to as the 80/20 rule, is a concept of prioritisation.
Apr
Databricks: Cluster Configuration
Databricks, a cloud-based platform for data engineering, offers several tools that can be used to
Apr
AI Assistance in Microsoft Fabric
The exponential growth of Large Language Models (LLMs) couples with Microsoft’s close partnership with OpenAI
Apr
10 reasons why it’s worth the effort to understand the value of your data
“If leaders really want to create a data driven culture, the journey starts with them!
Apr
Content Safety in Azure AI Studio
Azure AI Content Safety is a solution designed to identify harmful content, whether generated by
Apr
Model Benchmarks in Azure AI Studio
In the constantly changing field of artificial intelligence (AI) and machine learning (ML), choosing the
Apr
Celebrating International Women’s Day: from Classroom to Code
As we celebrate International Women’s Day, I want to share my journey of breaking stereotypes
Mar
Pretty Power BI – Adding Pagination to Bar Charts
Good User Experience (UX) design is crucial in enabling stakeholders to maximise the insights that
Feb