Solved

Sloooow SQL 6

Posted on 1998-12-29
11
200 Views
Last Modified: 2010-03-19
Hi guys,

I am having this nasty problem since 4 months, and I'm quite sure
that I've tried everything to solve this but I will try this last
shoot.

I have here a Pentium II 300 Mhz processor 192 Mb memory HP LH Server
dedicated solely to run the SQL server and approximately 30-40 users
accessing it.
As far as we know we're not having any kind of problems with the
network bandwidth and the performace did improved when we upgraded the
processor but doesn't have changed much increasing the memory.
We've changed the SCSI controller twice but we didn't see any
significant improvement.
Since we cannot change the version due to a company policy, Any Ideas?
Tnks
Carlos
0
Comment
Question by:CarlosDR
  • 3
  • 2
  • 2
  • +4
11 Comments
 
LVL 2

Expert Comment

by:tschill120198
ID: 1092408
What do you define as "slow"?  What are the problems?
0
 

Author Comment

by:CarlosDR
ID: 1092409
"Slow" means that a given SP takes 3 minutes but sometimes it could take 9 or 11 and no one is working in something special that uses too hard the processor
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1092410
The best way to track down what is holding up the stored procedure is to use Performance Monitor to monitor the CPU, the network and SQL Server objects. You may want to also monitor the disk and memory just to see what numbers you are getting for them. These will tell you a lot of what is going on and where the bottlenecks are.

For example, if the CPU usage is high, then the process is CPU bound and the only thing that will make the process faster is to get a faster CPU. You may want to consider getting multiple CPUs for the computer. SQL Server is multithreaded so you will in general get better performance and throughput if you have multiple CPUs.

If the disk usage is high, you may want to also look at the memory to see why memory isn't used for caching. Perhaps a complex query is return a huge recordset, if this is the case, try finding a different query to return a smaller recordset.

I can guess until I'm completely out of ideas and I probably still won't be able to come up with a good guess unless you post some comments that indicate exactly what is going on with performance monitor.
0
 
LVL 2

Expert Comment

by:tschill120198
ID: 1092411
1) Do all other sprocs and queries run slow?
2) Did this query run "ok" before 4 months ago?
0
 
LVL 1

Expert Comment

by:kponder
ID: 1092412
Can you post the stored procedure?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 18

Expert Comment

by:mdougan
ID: 1092413
One other point, you didn't mention if the slow stored procs were doing updates or not.  If it is updating that is slow, then you might want to see if you have placed your log devices on the same physical drive as the data devices (bad idea).  You might also re-examine what options you have set for logging (as this can slow a procedure down considerably).

For Select type stored procedures, perhaps you are joining on columns that are not indexed?  Perhaps you are not using clustered indexes for your primary keys?  Perhaps you are joining on calculated columns?  Lots of things to look for.  Posting the procedure could help.
0
 

Author Comment

by:CarlosDR
ID: 1092414
I wasn't quite specific, I am talking about a SP that takes an amount of time and, when you run it later the same SP takes 2 or 3 times longer to execute, there is NO users doing something strange, the DB doesn´t grow (at least not significantly)
I will try to post one sample SP that is causing me trouble
0
 

Expert Comment

by:MagicJ
ID: 1092415
If u r doing any updates, inserts or delets then check ur Rollback segment size.
0
 
LVL 3

Expert Comment

by:cognition
ID: 1092416
Have you got any triggers, indexes. Are there queries inserting lots of records.

What is a typical transaction volume.

Are there multiple inserts/deletions/updates going on while users are in the system ?
0
 
LVL 3

Expert Comment

by:cognition
ID: 1092417
If you right click on the server in EM, and then choose configure, and then look at the configuratin tab, what setting do you have under memory. The default will only give SQL very limited memory. With 192 Mb you should be able to increase this to 78125. That should increase perfromance a lot.
0
 
LVL 3

Accepted Solution

by:
cognition earned 200 total points
ID: 1092418
If the sp is run against tables that are having a lot of inserts and deletes, then the query optimiser may be using the wrong values. You should update the statistics, and force a recomile on the sp using sp_recompile, or adding WITH RECOMPILE to the CREATE PREOCEDURE ... WITH RECOMPILE AS
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now