I agree with João, the only difference that affects performance is that you are using the *
which will bring all the columns, which is a bad practice, and when bringing all the columns SQL has no information if you can opt for the use of a given Word.
For example, if you have a table with 10 columns (C1, C2 ... C10) and you have an input in the "C1" column when doing SELECT C1, C2 FROM Tabela C=1
SQL uses Intel because it knows where to look for information. Unlike you SELECT * FROM Tabela C=1
can’t do it.
More SELECT *
is not a recommended writing pattern because:
- If you specify columns in an instruction the SQL execution mechanism gives and I if that column is removed from the table.
- You should always write queries that return minimum data.
- If you have to use joins between tables, * set all columns to Join tables
If I’m not mistaken, both examples do the same thing. If in the second example you put only a part of the columns, then yes, there could be differences of performance.
– João Martins