Database SQL speed

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.
BBRRGGAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lluddenCommented:
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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LowfatspreadCommented:
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....
0
BBRRGGAuthor Commented:
Great, thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.