Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server Index and Performance tuning ETL Expand / Collapse
Author
Message
Posted Sunday, January 30, 2011 11:04 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, December 4, 2014 8:16 AM
Points: 43, Visits: 336
HI Im working as a SQL DBA where im currently supporting a lage volume of data migration from a legacy system to a brand new product.

One of the migrations consist of a large volume of data with billions of rows of data in some staging tables. I have a couple of questions here which im hoping the experts can contribute to in terms of performance tuning.

1) We have created a number of indexes to improve the read time of some queries. However these tables then have large inserts going into them. Does indexing not slow down the insert.
2) This specific migration is going to be running consecutively for over 24 hours. As a test I did a rebuild and reorganise half way through and this helped. Is this something valid to suggest in production.
Thanks


Post #1055908
Posted Sunday, January 30, 2011 10:37 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 9:22 AM
Points: 40,632, Visits: 37,094
avinash jobanputra (1/30/2011)
1) We have created a number of indexes to improve the read time of some queries. However these tables then have large inserts going into them. Does indexing not slow down the insert.


Yes. Indexing is a tradeoff. Test and see what kind of hit you take on the inserts. Usually a small number of indexes is fine, but do test.

2) This specific migration is going to be running consecutively for over 24 hours. As a test I did a rebuild and reorganise half way through and this helped. Is this something valid to suggest in production.


Absolutely. You should be doing regular index maintenance. Not rebuild and reorg, the latter is redundant, but something. This script's good if the DB is large. http://sqlfool.com/2010/04/index-defrag-script-v4-0/



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1055976
Posted Monday, January 31, 2011 2:43 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
When you are transfering large data to new table; I suggest you create just basic structure of the table i.e. without indexes, rules etc.

Once transfer is done you can create the required indexes depending on your queries.

This will be much faster.

HTH


---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Post #1056040
Posted Monday, January 31, 2011 5:57 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:26 AM
Points: 14,205, Visits: 28,536
free_mascot (1/31/2011)
When you are transfering large data to new table; I suggest you create just basic structure of the table i.e. without indexes, rules etc.

Once transfer is done you can create the required indexes depending on your queries.

This will be much faster.

HTH


Maybe, maybe not. Inserts into tables with a well-constructed clustered index are faster than inserts into a heap table. It's all the additional non-clustered indexes and foreign key constraints that can slow down inserts. But even these may benefit inserts depending on how the inserts are being done. You really have to address each situation individually and not use a blanket approach.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1056112
Posted Monday, January 31, 2011 7:45 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 11:44 AM
Points: 4,473, Visits: 6,404
Given that you have massive volumes of data to work with and yet are asking basic questions I really must encourage you to get a professional to help you with your migration efforts.

I will throw out that it can often be much more efficient to drop (some or all) indexes on tables that are going to have large amounts of data added to them in an ETL process and then rebuild them after load completion.


Best,

Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
Post #1056196
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse