Go Back   CORTEX Forums > Local Happenings > CORTEX Blogs > BI Monkey
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read

An SQL alternative to the SCD

This is a discussion on An SQL alternative to the SCD within the BI Monkey forums, part of the CORTEX Blogs category; In SQL 2008 a new T-SQL construct was added -*the MERGE operation. (Ok, pedants will know this wasn’t new to Oracle, *but it was new to SQL Server). This operation ...


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12th May 2010, 01:01 AM   #1
Guru
 
Join Date: Jun 2009
Posts: 122
James Beresford is on a distinguished road
Thumbs up An SQL alternative to the SCD

In SQL 2008 a new T-SQL construct was added -*the MERGE operation. (Ok, pedants will know this wasn’t new to Oracle, *but it was new to SQL Server).

This operation allows for the merging of*a dataset into a reference dataset – which can be remarkably similar to Insert / Update operations*effected by*the Slowly Changing Dimension transformation. However the way it operates is*very different. Instead of the SCD’s row by row evaluation approach, the MERGE operation is a set based operation. What this means is it compares the whole of the source dataset to the reference dataset in a single pass.*This has significant implications for performance – on a site where I implemented this the operation which took 1,200 seconds in the SCD cut down to 51 seconds using a Merge.

There are limitations and differences to be aware of:
  • You cannot directly*return row counts for Insert / Update / Ignore operations in the Merge
  • As it is*a bulk operation a single row will cause failure of the whole batch
  • There’s no GUI – just hand crafted SQL
  • Less error trapping / logging options
  • More flexibility in terms of actions when matches / non matches are found
The main reason why you would consider the SQL Merge – it handles Type 1, and with a little cunning, Type 2 dimensions – in a fraction of the time it takes the SCD to plod through. It’s still not as fast as a proper in memory comparison using something such as TableDifference*- but it’s always good to know you have something else available*in your toolkit.

Further information:

Get More from the original blog...
James Beresford is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTweet this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Leasing the Axa platform a NAB alternative Latest News Headlines 2010 Q2 News Headlines 0 22nd April 2010 10:43 AM
Seeking an alternative to the NBN Latest News Headlines 2010 Q2 News Headlines 0 6th April 2010 03:03 PM
Seeking an alternative to the NBN Latest News Headlines 2010 Q2 News Headlines 0 6th April 2010 04:08 AM
R and Bioconductor solutions for alternative splicing detection. admin Analytic News Feeds 0 31st December 2009 02:26 AM


All times are GMT +11. The time now is 09:39 AM.

© The Business Intelligence Group

Search Engine Optimization by vBSEO