Does the order of columns has a significant effect on INSERT?
-
22-10-2019 - |
Pergunta
Do we experience a noticeable difference in performance for these two queries?
INSERT INTO table (col1, col2, col3, col4, col5) ...
and
INSERT INTO table (col5, col3, col1, col2, col4) ...
Do we need to arrange INSERT
columns according to the order of columns in the table?
Solução
No, you don't need to gave the columns in the same order. Not least, table order may not reflect actual on-disk order (this is 100% true for SQL Server, and I'm sure MySQL is the same)
Unless your OCD itch needs scratched
Licenciado em: CC-BY-SA com atribuição
Não afiliado a dba.stackexchange