Groups | Blog | Home
all groups > sql server replication > august 2006 >

sql server replication : Performance Issue When Changing Identity from Yes to Yes Not for R



Larry Herbinaux
8/31/2006 4:33:01 PM
We created a script to create new tables for all tables that have an Identity
column. The new tables now have Identity (Not For Replication). We then
copied all the data to the new tables, dropped the old tables and renamed the
new temporary tables back to the original table name.

We then ran the following query to reindex the tables:

EXEC sp_MSforeachtable @command1="DBCC DBREINDEX (''?'') WITH NO_INFOMSGS"

We also ran sp_recompile on all of the stored procedures

After running our stored procedures a second time (e.g. after the recompile
has occured) we are seeing about a 5x performance degredation.

Is there something else we need to do to get back to our original
Larry Herbinaux
8/31/2006 4:59:02 PM
One thing I forgot to mention, in the script we are re-adding our indices to
the new table exactly as they were in the original table.

[quoted text, click to view]
Hilary Cotter
8/31/2006 10:05:57 PM
You may have introduced some fragmentation. I would update statistics and
then try a defrag.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



"Larry Herbinaux" <LarryHerbinaux@discussions.microsoft.com> wrote in
message news:C98D8860-8C8B-4305-9B6F-3BA13091A738@microsoft.com...
[quoted text, click to view]

Paul Ibison
9/1/2006 12:00:00 AM
Larry - reindexing will update the stats, and recompiling will be set to use
the new stats, so this part looks ok. I just wonder if the order of all this
was correct. Adding new indexes should be done before the recompile, and the
reindexing done before the recompile. Either way, I'd look at the execution
plan of the poorly performing query and check things are being done
correctly - accessing the indexes you expect. After that I'd run DBCC
SHOWCONTIG to check the index being used is not too fragmented.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com

Larry Herbinaux
9/3/2006 10:59:02 PM
Thanks Hillary,

I'm in South Korea right now on vacation, but I have my team working on this
right now.

Thanks again,

Larry

[quoted text, click to view]
Larry Herbinaux
9/3/2006 11:00:01 PM
Thanks Paul,

This has been helpful, we have been looking at the statistics and noticed
some issues with the databases.

Larry

[quoted text, click to view]
AddThis Social Bookmark Button