SSIS has so many properties that some are overlooked or ignored. In this article we will take a closer look at one of them: the “cache mode” setting of the Lookup Component.
As the name indicates, the “Cache mode” lets you choose which form of caching the Lookup component will use. The available modes are Full, Partial and None. By default “Full Cache” mode is selected. This is a good default value, but there are of course situations in which you might want to change it, otherwise there would be no need for the other modes.
Let’s have a look at how the different modes affect the behavior of the parent component. Once we know the impact, it will be easier to decide which mode to use in a given situation.
The entire lookup dataset is loaded into SSIS cache. Your dataflow waits until the cache is fully loaded before starting to do its lookups. This is the default setting, and it should be. For most situations this is the best setting. The only 2 situations when this setting shouldn’t be used, is when the Lookup data set is very large, or when the number of input records is really small compared to the lookup dataset.
Let’s combine these two cases in an example. Consider the situation in which your input dataset is only 2 records large. But the lookup dataset is over 200 million records. Using Full cache mode, SSIS loads the full 200 million records in memory, and then performs the lookup. All this, just to look up 2 values. A bit of overkill, isn’t it?
In this specific case, it would be much better to use the “No Cache” mode.
The easiest of the bunch. SSIS doesn’t keep any cache and sends a query to the reference DB for every record it needs to look up.
When to use?
Returning to the extreme example above, the “No Cache” setting solves all our problems. Instead of loading 200 million records in memory and doing the lookup there, SSIS queries the DB only twice, once for each row in the input data source. This is a huge gain in performance and server load.
Of course, there has to be a third situation, for which neither of these modes offers a good solution. Why else would we have 3 modes to select from? The third mode is a hybrid of the other two.
Let’s return to the example above, but increase the size of our input dataset to 10 000 rows. Investigating our input data we notice that although we now have 10 000 records, the number of unique values that need to be looked up is really small (let’s say 10). So we have thousands of input records and millions of records in our lookup dataset of which we only really need 10. If we would use “No Cache mode” we would query the DB for each record in the input dataset. Thus we would perform 9 990 useless lookups. Not an ideal solution by any means.
Luckily we have the Partial Cache mode to help us out in this situation.
With Partial Cache enabled, SSIS builds up a cache as it goes along. For each record SSIS checks if the value to look for is already known in its cache. If that value is not there, SSIS queries the reference DB and stores the result in its cache for future queries.
This way SSIS only retrieves the lookup records it really needs.
When to use?
As you can see, this is a perfect fit for our previous example. Though we have 10 000 input records, we only query the reference DB ten times at most. Once we have retrieved the lookup for a specific value, all further records with that value will use the cache.
Using the correct cache mode for the job can have a huge impact on performance and server load. While the default setting is correct most of the time, always keep in mind what it does, and change it if necessary.
Cookie | Duration | Description |
---|---|---|
ARRAffinity | session | ARRAffinity cookie is set by Azure app service, and allows the service to choose the right instance established by a user to deliver subsequent requests made by that user. |
ARRAffinitySameSite | session | This cookie is set by Windows Azure cloud, and is used for load balancing to make sure the visitor page requests are routed to the same server in any browsing session. |
cookielawinfo-checkbox-advertisement | 1 year | Set by the GDPR Cookie Consent plugin, this cookie records the user consent for the cookies in the "Advertisement" category. |
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
CookieLawInfoConsent | 1 year | CookieYes sets this cookie to record the default button state of the corresponding category and the status of CCPA. It works only in coordination with the primary cookie. |
elementor | never | The website's WordPress theme uses this cookie. It allows the website owner to implement or change the website's content in real-time. |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
Cookie | Duration | Description |
---|---|---|
__cf_bm | 30 minutes | Cloudflare set the cookie to support Cloudflare Bot Management. |
pll_language | 1 year | Polylang sets this cookie to remember the language the user selects when returning to the website and get the language information when unavailable in another way. |
Cookie | Duration | Description |
---|---|---|
_ga | 1 year 1 month 4 days | Google Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors. |
_ga_* | 1 year 1 month 4 days | Google Analytics sets this cookie to store and count page views. |
_gat_gtag_UA_* | 1 minute | Google Analytics sets this cookie to store a unique user ID. |
_gid | 1 day | Google Analytics sets this cookie to store information on how visitors use a website while also creating an analytics report of the website's performance. Some of the collected data includes the number of visitors, their source, and the pages they visit anonymously. |
ai_session | 30 minutes | This is a unique anonymous session identifier cookie set by Microsoft Application Insights software to gather statistical usage and telemetry data for apps built on the Azure cloud platform. |
CONSENT | 2 years | YouTube sets this cookie via embedded YouTube videos and registers anonymous statistical data. |
vuid | 1 year 1 month 4 days | Vimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. |
Cookie | Duration | Description |
---|---|---|
ai_user | 1 year | Microsoft Azure sets this cookie as a unique user identifier cookie, enabling counting of the number of users accessing the application over time. |
VISITOR_INFO1_LIVE | 5 months 27 days | YouTube sets this cookie to measure bandwidth, determining whether the user gets the new or old player interface. |
YSC | session | Youtube sets this cookie to track the views of embedded videos on Youtube pages. |
yt-remote-connected-devices | never | YouTube sets this cookie to store the user's video preferences using embedded YouTube videos. |
yt-remote-device-id | never | YouTube sets this cookie to store the user's video preferences using embedded YouTube videos. |
yt.innertube::nextId | never | YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen. |
yt.innertube::requests | never | YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen. |
Cookie | Duration | Description |
---|---|---|
WFESessionId | session | No description available. |