473,569 Members | 3,054 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Nov 23 '05 #1
4 4266
>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.

Nov 23 '05 #2
On 17 Nov 2005 06:21:22 -0800, Je************* **@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)
Nov 23 '05 #3


Je************* **@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

Nov 23 '05 #4
(Je************ ***@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, es****@sommarsk og.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
Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3364
by: Rigga | last post by:
Hi, I am new to mysql and need help on how to join tables. I have a database which contains 4 tables, the main table contains information by date order and the other 3 contain data also in date order. So I need to write a query that retrieves all the information for one record, lets say I want to query on the main table any entry that is...
6
2111
by: Bruce D | last post by:
Could someone please help to explain why the following query isn't using the index... explain select id from kbm where state = 'MA' table type possible_keys key key_len ref rows Extra kbm ALL State NULL NULL NULL 1000000 Using where The field 'State' is Char(2). It has an index.
4
10422
by: M Wells | last post by:
Hi All, I have a table that currently contains approx. 8 million records. I'm running a SELECT query against this table that in some circumstances is either very quick (ie results returned in Query Analyzer almost instantaneously), or very slow (ie 30 to 40 seconds to return results), and I'm trying to work out how I improve performance....
10
1801
by: ynott | last post by:
I have an Access database with 58 fields in one table. I wrote many of the field names so that they were descriptive so that others could figure it out in the future. As an example, one field name is called MissingPart14990aDescribe. Should I be worried about the length of the field name? I'm expecting about 20,000 records a year to be...
7
2582
by: DFS | last post by:
This UNION query is very slow. With only 3,000 records in the Parent table and 7,000 records in the Child table, it takes about 60 seconds to run and returns about 2200 records. Access 97. All appropriate indexes and keys enforced. Any ideas on speeding it up? Thanks. -- PART 1: HAS NO CHILD RECORDS
11
3133
by: Andy_Khosravi | last post by:
My problem: I'm having trouble with a query taking much too long to run; a query without any criteria evaluating only 650 records takes over 300 seconds to run (over the network. On local drive takes 120 seconds). The Setup: I'm running Access 97 non-developer edition. I have exactly zero other tools to use and no way to change that =(. ...
4
3704
by: Macroman | last post by:
MS Access XP, running on Win XP, Processor 2.4Ghz , 512Mb RAM, 40Gb Hard drive Table 1 has 167,000 records and contains the following fields tblone_custID tblone_easting tblone_northing Table 2 has 423,000 records and contains the following fields tbltwo_custID
4
5748
by: pmacdiddie | last post by:
I have an append query that needs to run every time a line item is added to a subform. The append writes to a table that is the source for a pull down box. Problem is that it takes 5 seconds to run. This makes adding lines to an order too slow for the users. The result of the query provides real time availabilty, so I really do need this...
9
2977
by: Bob Darlington | last post by:
The following query opens slowly the first time it is opened (6-7 seconds), but then is less than one second for the next random number of openings before slowing (6-7 seconds) again. SELECT tTenantDetails.LAN, tTenants.Archive, tTenants.PropNum FROM tTenants INNER JOIN tTenantDetails ON tTenants.LAN = tTenantDetails.LAN WHERE...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.