[gdal-dev] Coding for appending to a database in OGR

Frank Warmerdam warmerdam at pobox.com
Fri Oct 29 09:23:22 EDT 2010


Peter J Halls wrote:
> Frank and team,
> 
>    having reviewed the code again and the comments made by others, for 
> which thanks, it seems to me that there is a possible solution that 
> might resolve all the concerns.  I've asked my DBA for performance 
> expectation comments, but have not yet heard back from him.
> 
>    Instead of trying to track the current FID and where the caller has 
> not specified a value  'SELECT max(OGR_FID) + 1 FROM <tablename>' could 
> be used instead.  This will always return the maximum value plus one and 
> consigns the work to Oracle.  This will be 'safe' for multiple updaters 
> and saves the overhead / risk of enquiring the value and updating it in 
> the code.
> 
>    However, one side effect of this is that the value is not readily 
> known to OGR.  As this is only when writing a new feature to the 
> database, does this matter?  Is there any reliance on the FID within a 
> newly created / written feature having the destination FID value on 
> return - I suspect that, in the majority of instances, the next call is 
> to destroy the feature handle?  As this would be a change in behaviour, 
> at least it will be if I am correct that only the BoundCreateFeature 
> method is actually used, then this may be significant.
> 
> How do others regard this?  Is it a big issue or a non-issue?

Peter,

I am quite concerned about the performance impact of doing the MAX()
operation for every feature insert.   I also would consider it a major
disadvantage to not return the FID properly set on the feature.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list