performance in a select query [duplicate]

0

For the DBMS it is faster to get the fields all explicit or to use the * character representing all fields. If there is a difference what is the reason?

Select coluna1,coluna2,coluna3, .....,colunaN from

Or

Select * from
  

The question is very clear, explicitar TODAS as colunas ou usar * and yet I would like an objective answer 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.

    
asked by anonymous 27.08.2017 / 23:16

1 answer

1

There is some research that suggests that leaving the field explicit in a query makes the query faster, since using * the database should search for existing tables and only then display their contents. It depends a lot on the amount of data you have, but it is best to specify which columns are. If you use MySQL with PHP, and there is a change in the structure of the table how to add a new column, it can result in significant damage to your system if the query is done with * , or it can even cause data not to network through unnecessary processing and bandwidth.

link

    
28.08.2017 / 13:02