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