2 identically databases - 1 is fast and 1 is slow

Hi!

we've got a curious problem. we've two identicall databases, same tables, same date, same indexes, same server, both replicated.

One of them is our life database and the other is our development database. If I execute the following query at the development database the query takes less then one second. If I execute the same query at the live database the query takes about 4 seconds to complete. This is very unsatisfactory!!

What I've noticed is, if I try to analyze the query in the tuning advisor on the developement database it completes without tuning tips. If I do the same on the live database I get the following error:

TITLE: DTAEngine

The minimum storage required for existing physical design structures selected to keep is more than the default storage bound selected by DTA. Set the storage bound explicitly to be larger than 17 MBs using (1) Define max. space for recommendations (MB) under Advanced Options in Tuning Options screen in DTAShell or (2) -B option in DTA command line or (3) <StorageBoundInMB> under <TuningOptions> in input XML to DTA or select fewer PDS to keep.

What can we do? Is there any way to repair the database? Unfortunately we cannot easily recreate the database because the database is replicated.

We use SQL Server 2005 Standard Juni CTP.

Here's the our test query:
CREATE TABLE #tbl_Test
(
RS_ID uniqueidentifier,
TFV_T nvarchar(1000)
)

INSERT INTO #tbl_Test (RS_ID) SELECT TFV_RS_ID FROM tbl_xTableFieldValue
WHERE TFV_FD_ID = '4FD31E1D-8BEE-4211-89D1-26B63369E745'

UPDATE #tbl_Test SET TFV_T = TFV_T_Value FROM tbl_xTableFieldValue WHERE TFV_RS_ID = RS_ID
AND TFV_FD_ID = '4FD31E1D-8BEE-4211-89D1-26B63369E745'

SELECT * FROM #tbl_Test
DROP TABLE #tbl_Test

Best regards,
Markus

[1866 byte] By [MarkusFritz] at [2008-2-10]
# 1

The live database is probably under more load and is therefore more prone to performance problems.

Hopefully you're not using temp tables like this in the real application, otherwise this is the obvious reason for the speed problems...

Edit / Added: Also, indexes on GUID columns fragment very badly.. you have to use index defragmentation procedures frequently to avoid speed loss.

-Ryan / Kardax

RyanLamansky at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Database Engine...
# 2

From another thread :

This is by design.In your case you are specifing the maximum disk space
that the configurations recommended by Database Engine Tuning Advisor
can consume. If the data size (heaps+clustered indexes) plus the size
of unique indexes / constraints (for eg primary keys you define)
exceeds the storage bound then you get this message asking you to
adjust the bound. DTA does not recommend dropping any constraints that
you set - hence you need at least 17 MB .This in fact is the minimum
space required to keep your constraints and data. Hence you need to set
it as per the message.

Manojas at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Database Engine...
# 3

Where I work we use a ton of temp tables....

What do you recommend I do to NOT use temp tables in queries?

Mainiac007 at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Database Engine...

SQL Server

Site Classified