On Fri, 2010-05-14 at 12:37 +0100, Beat Forster wrote: > Hi Patrick > > > > > After reading the documentation of ContextSupport() it becomes a bit > >> > clearer, but not much. Where is the complete list of "support rules" > >> > that the plugin might have to handle? > >> There is currently only this rule supported by the engine. Originally > >> we thought there would be much more of them, but this wasn't the case > >> until today. > > > >Ah, okay. > > > >So what exactly is the meaning of ReadNextItem:allfields? What effect > >does it have when the plugin refuses to acknowledge that rule? > The whole item contents will be re-read with ReadItem later, if refused. > > When supporting the rule, the engine gets all > fields already with ReadNextItem, so they needn't > to be re-read later.
I see how that may improve performance. But why is it necessary to negotiate this behavior in advance? According to the documentation, the plugin may refuse ReadNextItem:allfields and then fill in the data anyway. At least this is my understanding of "\<aItemData> can be returned, if anyway available or ..." Use the source, Patrick... indeed, the source seems to confirm that the engine doesn't care at all whether the plugin knows about "allfields": // just let plugin know if we want data (if it actually does is the plugin's choice) if (aNeedAll) { // we'll need all data in the datastore in the end, let datastore know // Note: this is a suggestion to the plugin only - plugin does not need to follow it // and can return only ID/changed or all data for both states of this flag, // even changing on a item-by-item basis (can make sense for optimization). // The Plugin will return "1" here only in case it really follows the suggestion // an WILL return all data at ReadNextItem(). Otherwise, it may or may // not return data on a item by item basis (which is handled by the code // below). Therefore, at this time, the engine does not make use of the // ContextSupport() return value here. fDBApi_Data.ContextSupport("ReadNextItem:allfields\n\r"); } What exactly does "aNeedAll" mean here? Let me guess: if the engine only needs to know changes, it will not call ContextSupport("ReadNextItem:allfields") and performance is best when the plugin does not return data in ReadNextItem. If the engine needs all changes and the corresponding data, performance is best when the plugin returns the data right away. Always returning the data in ReadNextItem leads to bad performance when the engine doesn't really need it, thus the hint. I think this needs to be explained more explicitly in sync_dbapi.h. -- Best Regards, Patrick Ohly The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter. _______________________________________________ os-libsynthesis mailing list os-libsynthesis@synthesis.ch http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis