Database SQL speed

BBRRGG used Ask the Experts™
I have a query that pulls from several tables.  There are about 750,000 records in one table, joined to another that contains about 7000 records, with a couple other joins.

My query makes a computation that looks at all records (adds, then averages based on a where clause, etc.)  This is taking approx 1.5 minutes.

Is it reasonable for me to expect that with proper design, indexing, SQL, etc... this execution time could be reduced to a few seconds?  Or, with that many records, is it inevitable that it will take 60+ seconds to execute?

The DB is housed in SQL Server, GoDaddy is the host.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Just for comparison, I did the following query in less than 2 seconds.

SELECT avg(BillableAmt), count(*), sum(t.BillableAmt)
 FROM Transport t
 INNER JOIN Clients c ON t.ClientNumber = c.ClientNumber
WHERE c.firstname <> 'A'

Transport has about 2.7 million rows and Clients has about 80,000

Top Expert 2011
if you can utilise indexes in the query then you can expect an imporvement....

e.g. you don't require the use of functions when accessing the indexed columns....


Great, thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial