-
which one is faster
Hi
This is an interview question.
which one is faster
select * from table
or
select col1, col2 from table
Bye
-
"Bye" back is all you're probably going to get in response. No ideas or experimentation of your own?
Bye
-
-
I would say that the second SQL might be faster, because the table may have more columns than col1 and col2, and it could be that the result for the second query could be derived from an index scan or fast full index scan faster than a full tablescan could retrieve the "Select * ...".
If the table has no other columns, then any difference would be absolutely minute and irrelevant. I'd regard "Select col1, col2 ..." as better practice than "Select * ..." though, for maintainability purposes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|