[fdo-users] How to boost ISelect and IUpdate command performance

Traian Stanev traian.stanev at autodesk.com
Tue Nov 30 11:58:23 EST 2010


In cases when you want to access the features in a certain order.

The solution I've used in the past, and is slightly simpler (but equivalent) than the one Romy posted:

FdoPtr<FdoIdentifier> idid = FdoIdentifier::Create(idname);
FdoPtr<FdoInt32Value> idval = FdoInt32Value::Create(0);
FdoPtr<FdoFilter> fidfilter = FdoComparisonCondition::Create(idid, FdoComparisonOperations_EqualTo, idval);
select->SetFilter(fidfilter);

for (...)
{
   idval->SetInt32(some_other_id); //update the filter with a new ID value
   FdoPtr<FdoIFeatureReader> rdr = select->Execute(); //execute the select again
   rdr->ReadNext(); //read the result
   ....
}

It skips the use of a parameter value. However, I've only tried this to work with SQLite, SDF and SHP. I don't know if there are other providers which require the use of a parameter value in between the comparison condition and the integer value. For the wider context of this example check SQLiteConverter.cpp in the SQLite provider sources.

For the update command, you can reuse a single IUpdate object and pre-populate the PropertyValueCollection of the IUpdate and on each iteration update the property values only. However, the speed gain of this with updates will not be huge.

Traian


> -----Original Message-----
> From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-
> bounces at lists.osgeo.org] On Behalf Of Jonio, Dennis (Aviation)
> Sent: Tuesday, November 30, 2010 10:55 AM
> To: FDO Users Mail List
> Subject: RE: [fdo-users] How to boost ISelect and IUpdate command
> performance
> 
> Maybe I don't understand fully the need to do a one-at-a-time query vs.
> a set-at-a-time. Does your provider support "IN"? (UFID IN
> (XXXX,XXXX,XXXX)) or even (UFID = {0} OR UFID = {1}).
> 
> It would seem to me that iterating a reader, even multiple times, would
> be significantly faster than hundreds of thousands of queries.
> r,
> dennis
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users


More information about the fdo-users mailing list