Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Cpu Usage Of Simple Select Query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-03-02 : 07:32:40
farnaz writes "Why cpu usage get High(100%) when Executing a simple Select Query(From Query Analyzer)?
In Some Cases That The Table In Select Query Has Large Amount of Data ,this highness of cpu usage will distiribute the programmer
And EndUser?what Can I do As Programmer?"

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-03-02 : 08:41:49
Don't execute the CPU from Query Analyzer if it's going to disrupt your users. That's what you have a development and staging environment for.

If you have to run this query, make a stored procedure and only get the data you need. Nobody ever has to look at more than a 1000 rows or so during the middle of production hours, with rare exceptions. In other words, plan a little ahead and consider the consequences.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-02 : 12:50:21
If you need to view data in production, use TOP.

SELECT TOP 100 *
FROM Table1
WHERE...

It's also better if you provide an explicit column list. But whatever you do, don't return all rows back to the client. If you are running the query from the database server's console, then you are chewing up memory by doing so.

Tara
Go to Top of Page
   

- Advertisement -