propelorm/Propel — pull request #527 by havvg (2012-12-05 15:56:57+00:00)
Title: [VersionableBehavior] do not load unnecessary data from database

This patch stops loading "all" the database when determining whether versioning for a specific model is necessary.

I'm not 100% sure, whether this is true; I assume you need to load the related object or initialize the collection that is related to the model in question. If it's not already present, there is no way you can change it in relation to the model.

We reduced a simple `UPDATE` operation on a model under versioning which relation-tree has multiple models also under versioning from 92 queries down to 3. Those 89 queries in question are only loading related objects to check whether there are modified, which is not possible, when they are not loaded from the database by then.

It also solves a `Lock wait timeout` issue on Amazon RDS instances. However I'm not sure why the LOCK appeared in the first place.