tags:

views:

119

answers:

3

If you submit an update statement to a RDBMS in which the order of the column_name = value mappings don't match the physical layout of the file, does it affect (theoretically) the efficiency of the update operation?

I ask mainly out of curiosity, knowing full well that there's probably little effect.

+2  A: 

If your DB engine is so poor as to be unable to optimize updates in this case, you certainly have worse problems to worry about:-(. IOW, there had better be no effect -- this is a matter of quality of implementation for the DB engine, but it's such a trivial one that I'd be appalled and astonished if it were otherwise.

Alex Martelli
Further, the order of fields within a database-managed disk page is an implementation detail.
Dave W. Smith
A: 

No.

However, there are things you can do to improve UPDATE effciency, including only updating rows and columns that need to be updated.

Cade Roux
A: 

I can say, in SQL Server and in Oracle, this is 'planned out' in the 'execution plan' stage and you will not notice a performance change when changing parameter ordering. I can't speak to some of the other 'less-enterprise' databases out there (SqLite, Firebird, Pervasive), but I expect that all databases will perform these steps when they parse the SQL statements into database operations.

JasonRShaver