Possible Duplicate:
Which is faster/best? SELECT * or SELECT column1, colum2, column3, etc
What is the reason not to use select *?
Is there any performance issue in using SELECT * rather than SELECT FiledName, FiledName2 … ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you need a subset of the columns, you are giving bad help to the optimizer (cannot choose for index, or cannot go only to index, …)
Some database can choose to retrieve data from indexes only. That thing is very very helpfull and give an incredible speedup. Running SELECT * queries does not allow this trick.
Anyway, from the point of view of application is not a good practice.
Example on this:
SELECT C1, C2 FROM T WHERE C1=123Instead if you
SELECT * FROM T WHERE C1=123, the optimizer needs to get all the columns data, then the index on (C1,C2) cannot be used.In joins for multiple tables is a lot helpful.