Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Performance of deleting versus updating

 
   Database Help (Home) -> Data Warehouse RSS
Next:  SSIS: Object reference not set to an instance of ..  
Author Message
HoloDoc

External


Since: Mar 04, 2008
Posts: 1



(Msg. 1) Posted: Tue Mar 04, 2008 3:00 pm
Post subject: Performance of deleting versus updating
Archived from groups: microsoft>public>sqlserver>datawarehouse (more info?)

Hi,
I am building a DW in SQL2005.

There are many master files that are imported nightly. There is a chance
that old master file records may have been deleted (from source system) so i
need to merge all existing master file records with any records that exist in
the DW but have been deleted in the source system.

Is it better (performance/log wise) to perform
1. Update all fields in the DW table with results from the nightly extract
and then insert any new master file records
2. Delete all records from DW that have been imported then insert all master
files records into the DW table (basically updating existing records and
inserting any new ones).
3. Another options maybe?

Options one and two give the same result however are completely different
approaches. As we are doing this with 100,000's records a night i want this
process to be as efficient as possible.

It really is a question of is 100,000's of updates better than doing
100,000's of deletes and inserts.

Thanks.

Simon.

 >> Stay informed about: Performance of deleting versus updating 
Back to top
Login to vote
ML

External


Since: Jan 15, 2008
Posts: 380



(Msg. 2) Posted: Thu Mar 06, 2008 1:36 am
Post subject: RE: Performance of deleting versus updating [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Assuming you're using SSIS, have you considered using slowly changing
dimensions? (Let BIDS take care of business.)


ML

---
Matija Lah, SQL Server MVP
http://milambda.blogspot.com/

 >> Stay informed about: Performance of deleting versus updating 
Back to top
Login to vote
Knowledgy

External


Since: Jan 14, 2008
Posts: 55



(Msg. 3) Posted: Thu Mar 13, 2008 10:09 pm
Post subject: Re: Performance of deleting versus updating [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

This won't help you until you're running sql server 2008 but I'll put this
out there anyway. 2008 has a ,MERGE statement that performs this logic
automatically (like Oracle's merge clause). I believe, you'll have to
verify this) that it is doing update/insert logic, not delete/insert logic

--
Sincerely,
John K
Knowledgy Consulting
http://knowledgy.org/

Atlanta's Business Intelligence and Data Warehouse Experts


"HoloDoc" wrote in message

> Hi,
> I am building a DW in SQL2005.
>
> There are many master files that are imported nightly. There is a chance
> that old master file records may have been deleted (from source system) so
> i
> need to merge all existing master file records with any records that exist
> in
> the DW but have been deleted in the source system.
>
> Is it better (performance/log wise) to perform
> 1. Update all fields in the DW table with results from the nightly extract
> and then insert any new master file records
> 2. Delete all records from DW that have been imported then insert all
> master
> files records into the DW table (basically updating existing records and
> inserting any new ones).
> 3. Another options maybe?
>
> Options one and two give the same result however are completely different
> approaches. As we are doing this with 100,000's records a night i want
> this
> process to be as efficient as possible.
>
> It really is a question of is 100,000's of updates better than doing
> 100,000's of deletes and inserts.
>
> Thanks.
>
> Simon.
 >> Stay informed about: Performance of deleting versus updating 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Near Real time updating of fact table - -what is the best method that to implement the near real time updating of a fact table without affecting all those users who are reading from it? -fact table in question is only 1.8gb in size, 3.1 million rows, expect near real time updating of approx....

Updating data in a data warehouse - I found this thread about whether to update fact tables in data warehouses, other than for errors in the data. ..

SQL Scheduled Jobs - Is there a way to monitor schedule jobs and restart the jobs automatically when it faills and if it fails then notify the responsible person, is there a tool to do this ?

Running total with "treshold value" detection..? - Hi, I have to create a query which evalaute, for each year, the employees who reached a particular number of absences and when this value is reached. I have 1 000 000 records in my absence table. my table is like this: DateID, EmployeeID, ActivityID,...

Problem with multiple instant of SQL Server - I have 2 instant of SQL server on the same machine. 1st instant keep most of the static information - Dimensional data 2nd instant keep most of the transaction information. When I try to use the Analysis Services, I have 2 connection, but they can't ..
   Database Help (Home) -> Data Warehouse All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]