Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 query execution took more time

Author  Topic 

imughal
Posting Yak Master

192 Posts

Posted - 2009-09-18 : 02:48:11

Hi,

i have table with more than 5000000 records, table has 20 coulmn. when i run select * from mytable it took more than 5 min to execute on query analyzer.

is there anyway to optimize the performance and cut down execution time.

thx

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-09-18 : 03:11:32
Yes that's easy.
Don't use *. Use only needed columns.
Use WHERE clause to filter the data because I think you don't wanna read 5000000 rows...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2009-09-18 : 12:32:26
also create index on column which you will use in where clause.
Go to Top of Page
   

- Advertisement -