Advertisement

03.12.2008 at 01:40PM PDT, ID: 23236654
[x]
Attachment Details

How to increase response time if no WHERE clause?

Asked by BrianMc1958 in MS SQL Server

Dear Experts,

In my app, I need to select ALL the rows in a table containing 60 million rows.  Just returning the rows is taking a  hour.  That's too slow.

To test this, I'm now using Management Studio to return all the rows in a 2 million row table.  Similarly, it's taking about two minutes.  I'm just saying "SELECT * from MyTable", with no WHERE.

Does this mean that there is no way to get all those records in my filthy little hands faster?  In my app, I can imagine using a different driver, or Hibernate, or something.  But if I'm in Management Studio directly, on my own private box no one else is using, and it still takes one minute per million rows returned, have I reached a speed limit?  Or is there a way to get them a lot faster?

As a bonus, can you folks confirm that what's taking the time is that SQL Server is actually writing all those records to some temporary table, like in temp db? I find that with my 2 million record table, I can return, say, all rows with some random, non-key value in a couple seconds.  So I know it can "look" at all those records very quickly.  It's "RETURNING" them to me that takes time, right?

Thanks!
BrianMc1958
 Start Free Trial
[+][-]03.12.2008 at 01:43PM PDT, ID: 21110561

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Sign Up Now!
Solution Provided By: cmangus
Participating Experts: 4
Solution Grade: A
 
 
[+][-]03.12.2008 at 01:44PM PDT, ID: 21110565

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 01:55PM PDT, ID: 21110676

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 01:57PM PDT, ID: 21110696

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 02:04PM PDT, ID: 21110758

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 02:43PM PDT, ID: 21111089

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 02:47PM PDT, ID: 21111125

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.12.2008 at 02:58PM PDT, ID: 21111222

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 08:57PM PDT, ID: 21113233

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.12.2008 at 08:58PM PDT, ID: 21113236

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628