July 19, 2006 at 10:39 am
Hi,
I have a stored procedure. When this stored procedure was run in production database, it ran for 15 minutes. I have restored the copy of the backup of the same production database (exact copy of production) on my desktop. When I ran this stored procedure on this instance it took 15 hours.
Nothing has been changed as far as data is concern. I checked the indexes. They are also same as production. What else should I check for? Why is it taking so long?
Thanks i nadvance
July 19, 2006 at 10:48 am
Hopefully your Production Hardware is better than your desktop
* Noel
July 20, 2006 at 12:54 am
Try:
EXEC sp_msForEachTable 'EXEC sp_recompile ''?'''
Andy
July 20, 2006 at 8:01 am
What is the purpose of this statement?
EXEC sp_msForEachTable 'EXEC sp_recompile ''?'''
Thanks
July 20, 2006 at 9:46 am
If hardware is similar then you may need to do a little maintenance. It may alleviate your performance disparity.
Here's my 'short list' for tuning:
Round I
DBCC UPDATEUSAGE
UPDATE STATISTICS (with FULL scan) for all tables
exec sp_recompile for all tables
exec sp_refreshview for all views
Round II
DBCC DBREINDEX
UPDATE STATISTICS (with FULL scan) for all tables
exec sp_recompile for all tables
exec sp_refreshview for all views
Round III
Profiler
Query Hints
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
July 20, 2006 at 11:26 am
check/compare Estimated Execution Plan on both Prod and Local box...
July 21, 2006 at 3:24 am
That big a discrepancy and that way around, I immediately would think of lack of physical memory or, perhaps, an anti-virus or other process on the desktop interfering.
July 21, 2006 at 7:34 pm
Noeld probably hit the nail on the head... the server should be much faster than your desktop machine for multiple reasons...
1. Memory... chances are your desktop computer has between 512Mb and 2GB... your server could easily have between 8 and 64Gb.
2. Disk system... chances are the disk system on the server is a san or fast wide scsi system with a gazillion more r/w heads than your desktop system... your desktop is most likely a limited bandwidth IDE.
3. Setup... there could be a lot of differences but chances are, your server has some pre-sized DBs with logs that have already been grown. This includes TempDB which is very important to performance. Chances are, your DBA pregrows it to something between 8 and 16GB (or the system grew it and hasn't been rebooted in a while). Your desktop system is probably setup to start at 1Mb with 10% growth which takes something like 73 growths to make anything really useable in TempDB. Your machine will freeze during each growth. And then, you have a horribly fragmented disk and database which also affect performance.
4. Cpu's... chances are, your server has between 4 and 16 cpus. Your desktop computer probably only has one or maybe two. Your desktop computer has no chance at performing parallel tasks.
You're comparing grape seeds to coconuts... Why do you think severs cost so much?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply