-1
For DBMS what is faster to receive all the fields specified or use the character *
which represents all fields. If there is a difference, why?
Select coluna1,coluna2,coluna3, .....,colunaN from
Or
Select * from
The question is quite clear,
explicitar TODAS as colunas ou usar *
and yet I would like an objective response focused only on that condition.It is not desirable that the answers to this question be based on opinions but rather on facts, references or specific experience.
I believe that the fewer fields you request, the faster the query becomes. But let’s wait for the more experienced to speak.
– Italo Rodrigo
Possible duplicate of Number of columns influences performance? and Why using "SELECT * FROM table" is bad?
– Guilherme Nascimento
The question was quite clear, "specify all columns or use *" and do not use whatever is necessary
– user76097
For the DBMS it is faster to receive the command with all fields specified. Using * forces the server to query which fields are before searching the data, creating one more step in the process. Source http://www.devmedia.com.br/sql-select-guia-para-beginners/29530
– user60252
When I started using Mysql I was instructed to select the fields I will use, even more when there are many in the table, or when I will JOIN.
– Sam
@Leocaracciolo This is not totally true (ie it is true but not for all cases), each engine has a behavior, it may be that a query with
*
is optimized for a specific type of mysql engine, it is not possible to say anything, besides that in any way this is usually micro-optimization and therefore it is hardly this kind of thing that will harm the database, of course it depends a lot on the server, engine and/or settings.– Guilherme Nascimento
@Please read the answers to this question, see if it answers: https://answall.com/q/21583/3635
– Guilherme Nascimento