Unix Technical Forum

Query returning 1.7million records slow

This is a discussion on Query returning 1.7million records slow within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, I have a sql server database with 1.7 million records in a table, with about 30 fields When ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 02:57 PM
JeremiahOSullivan@gmail.com
 
Posts: n/a
Default Query returning 1.7million records slow

Hi,

I have a sql server database with 1.7 million records in a table, with
about 30 fields

When I run select * from tablename it can take over 5 minutes.

How can I get this time down or is it normal?

Thanks
Jerry

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 02:57 PM
ZeldorBlat
 
Posts: n/a
Default Re: Query returning 1.7million records slow

>I have a sql server database with 1.7 million records in a table, with
>about 30 fields
>
>When I run select * from tablename it can take over 5 minutes.
>
>How can I get this time down or is it normal?
>


Perfectly normal.

What exactly are you trying to do? If you just want to export every
row in the table to a csv file or something, use BCP or DTS. If you
only want certain rows (or fields) then I would adjust the query
accordingly.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 02:57 PM
Hugo Kornelis
 
Posts: n/a
Default Re: Query returning 1.7million records slow

On 17 Nov 2005 06:21:22 -0800, JeremiahOSullivan@gmail.com wrote:

>Hi,
>
>I have a sql server database with 1.7 million records in a table, with
>about 30 fields
>
>When I run select * from tablename it can take over 5 minutes.
>
>How can I get this time down or is it normal?


Hi Jerry,

1.7 million rows of 30 columns each is a lot of data. The performance
might well be limited by the network capacity or by the processing that
the client does on the data.

Does the client really need all these rows? Try to refine your query -
send only those columns and those rows across the network that the
client actually needs. Pre-aggregate at the server if the client will
only use aggregates.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-29-2008, 02:57 PM
Joe Weinstein
 
Posts: n/a
Default Re: Query returning 1.7million records slow



JeremiahOSullivan@gmail.com wrote:

> Hi,
>
> I have a sql server database with 1.7 million records in a table, with
> about 30 fields
>
> When I run select * from tablename it can take over 5 minutes.
>
> How can I get this time down or is it normal?
>
> Thanks
> Jerry


It sounds fast actually. This isn't something you should be doing
very often anyway. What are you doing with all that data out of
the DBMS?
Joe Weinstein at BEA Systems

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-29-2008, 02:59 PM
Erland Sommarskog
 
Posts: n/a
Default Re: Query returning 1.7million records slow

(JeremiahOSullivan@gmail.com) writes:
> I have a sql server database with 1.7 million records in a table, with
> about 30 fields
>
> When I run select * from tablename it can take over 5 minutes.
>
> How can I get this time down or is it normal?


Running a SELECT that returns 1.7 milions rows is not normal...


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:50 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com