December 5th, 2003, 05:49 PM
sql queries taking longer
I have a survey site that allows people to sign up for an account and create their own surveys and collect data on my server.
Before I had any customers, the speed of retrieving survey data was very fast. But, it is becoming progressively slower to retrieve data the more customer accounts there are. Many accounts have surveys with 20 or 30 questions and with 100+ responses.
I even did a parallel test with the same survey and retrieved survey data from one database that had just one customer account and then one from my current database with 1000+ customer accounts. In some cases it took 3 minutes on the larger database to pull survey data that could be pulled in just a few seconds with the smaller database.
First of all, why is this happening? Second of all, I want to determine how to optimize my site (which is written in .net (.aspx) and uses sql 2000 so it will run just as fast with a thousand accounts as it would with one account.
Any thoughts on what could be going on and what I could do to fix this? Thanks.
December 8th, 2003, 03:13 PM
U probably need a few indexes added to the tables. Do you have access to Query Analyzer? If so, do the following:
(a) Enter the query that you want to profile.
(b) Type Ctrl-L to display the Estimated Execution Plan (or hit the speed button for this -- should be to the right of the database selection combo box).
(c) In the Estimated Execution Plan diagram, determine which parts of the query take the most time and add indexes as needed.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo