Link to home
Start Free TrialLog in
Avatar of Ricky White
Ricky WhiteFlag for United States of America

asked on

Sql queries faster?

We are using Sql Server 2k and a VB 6 application.

I find some of the SQL queries take about a minute to retrieve a single record. But then if I try to retrieve the same record a second time it loads pretty quickly in 5 seconds.

What are some of the ways to optimize SQL performance? Would upgrading to newer SQL versions significantly improve performance?
SOLUTION
Avatar of yawkey13
yawkey13
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That is why I asked for this query and table structure.  My intent is to tell him what index(es) to create and why we are created them.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What's the size of the db and how much memory does the server have? Keeping the db in memory can sipped things up significantly if possible. If you can rdp into the server you can see if the query is CPU or io bound...
Indexes are the think to look at first here, I'd definitely go down that route before spending money - you might well be able to get 60 and 5 seconds down to zero seconds.
Hi,

Agree with all experts above. It is most likely about missing index on that particular query.

For a complete check list to optimize your SQL Server application performance, see here
http://msdn.microsoft.com/en-us/library/ff647681.aspx
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I suspect the author no longer cares or has left the building...
Avatar of Ricky White

ASKER

Thanks all! The issue was with the Sql query.