Total Pageviews

Monday 25 February 2013

Which is faster? Select * from table or select 'all Columns' from table??

Many of us would have come across a scenario where listing column names in select SQL was found to be faster than using select * from table command. This indeed is interesting.

The reason being,

In case of using "select * from table", an extra stage is added where * is replaced by column names by teradata and then it would fetch the data.

But using "select <all Columns > from table” eliminates this extra stage of verifying and fetching on columns from the table.

Hence it is always recommended to use "select <all Columns > from table”

1 comment: