One question which came up during the presentation was to do with the Relational Database Access Service and whether it optimizes the SQL queries it creates in order to remove redundancies. The short answer is, "no", but that's simply because it doesn't have to; SDO does the optimization for it.
The first thing to note is that SDOs keep a change summary, however, this summary only holds the information required to re-create the data object's original state, not any intermediate states. This is important when it comes to understanding how the updates are optimized.
Consider an example of a contact database (as described in this article). The contact database table contains a "shortname" column (e.g. "Fred") and a "fullname" column (e.g. "Frederick Flintstone"). Let's assume we've retrieved a set of contact SDOs from the database into the variable
$result. We then perform the following four modifications:
// Create and set a new contact.
// The change summary records the fact that the new contact was created.
$new_contact = $result->createDataObject('contact');
$new_contact->shortname = 'Bertie';
// Delete the new contact.
// The change summary entry for the new contact is cleared.
// It's as if 'Bertie' never existed.
// Change the name of the first contact to "Sally Smith".
// Sally was previously called "Sally Barker", so the old
// name is stored in the change summary.
$result->contact->fullname = 'Sally Smith';
// Change the name of the first contact to "Sally Jones".
// The intermediate value of "Sally Smith" is not recorded
// in the change summary.
$result->contact->fullname = 'Sally Jones';
The create and delete cancel each other out and the intermediate value of "Sally Smith" is not recorded, so the resulting change summary would only show that "Sally Barker" had changed her name to "Sally Jones". Consequently, when the Relational Data Access Service is asked to apply the changes back to the database, the only update it would see and perform is the name change.
The resulting SQL UPDATE statement would look like this:
UPDATE contact SET fullname=? WHERE id=? AND fullname=?
with a parameter list of ("Sally Jones", primary key value, "Sally Barker")
SDO for PHP Project
SDO for PHP documentation
Relational Data Access Service documentation