My Table has only 2 Columns
`Select * from table` ----Execution time 10 second
Select name,mobile from table--Execution time 5 second
My Table has only 2 Columns
`Select * from table` ----Execution time 10 second
Select name,mobile from table--Execution time 5 second
Select *
and Select Columns
doesn't have any differences when you are scanning the whole table..
Below differences can crop up when you use unnecessary columns
1.Scan of whole another table due to Rowlookup cost exceeding limit
2.Sending data over network
In your case the difference can be due to locking,blocking,memory pressure...whole lot of reasons..but not due to expanding all columns vs *
Excerpt from Conor cunningham on the same..
Did you do 'select *', then 'select name, mobile' right after ? If yes, then it's warm caching. Your data is in memory. The second query runs faster.