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.
Author |
Topic |
yomi
Starting Member
25 Posts |
Posted - 2013-02-01 : 05:09:00
|
I have two query'sselect * from tableNameANDSelect col1,col2 from tableNameWhich One is faster and why?Yogesh |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-01 : 06:33:55
|
depends on factors like presence of indexes, total columns in table etc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
yomi
Starting Member
25 Posts |
Posted - 2013-02-01 : 06:41:37
|
Hi visakh16,how it is depends on number of columns in table and why i want small brief answer.Yogesh |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-01 : 06:50:02
|
it will see if it can read columns from index easily over traversing whole table, based on that optimizer might decide to use the index table or read from the actual table. If its small dataset, it will go for table scan (or clustered index scan if present) in most cases.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2013-02-01 : 08:43:13
|
Visakh, can you answer homework question #5 also? Thanks. How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-01 : 12:23:50
|
quote: Originally posted by DonAtWork Visakh, can you answer homework question #5 also? Thanks. How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Sureat least it was more of conceptual one ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|