I have table Report which has 10+ columns, where each field except autoincrement id is varchar. Maximum size of any row of table is ~80000 bytes.
I observed the considerable amount of difference between below 2 queries where both server and client are on the same system(with ~1.5M rows)(also having index on column name)
select * from Report;
&
select name from Report;
I went through other stackoverflow ques, where Ans suggesting that
"One reason that selecting specific columns is better is that it raises the probability that SQL Server can access the data from indexes rather than querying the table data. "
My Ques are :
1) Even when using index we need to read from actual DB(i.e. Disk), so same Disk I/o will get performed when we selecting single column or multiple columns(let say by using *).
2) Can someone explain it with little internals that why there is a difference between single column select and multiple column select. As I understood databases try to store the complete row in same disk sector.
Let say for some query for User table like
select first_name from user &
select first_name, age from user
3) Does DB perform same disk I/O(for above queries), or disk I/O's may differ and what if User table has more then 10 columns and we are selecting 5~8 cols still disk I/O remains same?
Already read in other Ans that using select * is not preferable and it may cause issues with views and maintenance(cases when adding new columns to DB)
It maybe a silly que, since still learning databases(newbie to subject). Please provide link if some ques already answered anywhere.