> > It is conceivable that multiple update records on a single entry be done, > due to complex conditions (e.g. under certain conditions, you update stock > but not description, etc.) > > Since web2py either commits or rollbacks at the end of each request, all > the works are done then. Therefore, it makes sense certain optimization > can be done to reduce these 3 queries to only 1 query. >
Certain what ? I really don't get the meaning of this and it's starting to feel a little nonsense arguing that web2py doesn't "optimize" what are you *forcing* it to do.... if you use product.update_record() 3 times it's because you *need*it. If you don't need to update the records on the db every change of "attribute" (for ORM, "column" for DAL), nobody is forcing you to use the update_record() statement. e.g., you could easily do product.update(description = 'product description') product.update(stock = 11) product.update(code = 'abcfed') mind that these are only updates on the "dict" object representing the row, without any SQL fired to save those changes on the db. You can then use product.update_record() that fires the only required query at the end of your code. --