Bytech India
asked on
Delay in Query Execution time
I have 2 databases , let us say A & B. I run a Query with multiple innere joins . Database A contains 4 times records than database B.
My query takes 1 seconds to get executed in Database "A" and 5 minutes in Database "B".
The Database structure of A & B is same , In fact "B" has been created from Dump of "A". What could be the possible cause of such delay.
My query takes 1 seconds to get executed in Database "A" and 5 minutes in Database "B".
The Database structure of A & B is same , In fact "B" has been created from Dump of "A". What could be the possible cause of such delay.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
BYTECHINDIA,
Create Indexes on Table B , and afterwards issue a update statistics with full scan.
Best Regards,
Paulo Condeça
Create Indexes on Table B , and afterwards issue a update statistics with full scan.
Best Regards,
Paulo Condeça
ASKER
The Databases are in SQl Server 2000.
* As such there are no Indexes in any of the databsae.
* Both the Database are running on the same Machine.
* The database have been checked and validated and are found to have same Structure.
Kindly suggest any varification/resolution
* As such there are no Indexes in any of the databsae.
* Both the Database are running on the same Machine.
* The database have been checked and validated and are found to have same Structure.
Kindly suggest any varification/resolution
BytechIndra,
There could by external fragmentation on the Physical Disk.
You could also run a dbcc showcontig in the 2 DB and compare values.
This will give you a view ( basic ) of your DB's
Best Regards,
Paulo Condeça.
There could by external fragmentation on the Physical Disk.
You could also run a dbcc showcontig in the 2 DB and compare values.
This will give you a view ( basic ) of your DB's
Best Regards,
Paulo Condeça.
1-Run DBCC SHRINKDATABASE on database B with truncateonly Option
2-Run DBCCCHECHDB on database B Or Run DBCC CHECKTABLE
2-Run DBCCCHECHDB on database B Or Run DBCC CHECKTABLE
usually, this is due to missing or outdated statistics, or missing indexes.