Improve performance of Oracle OGR driver
|Reported by:||avautour||Owned by:||warmerdam|
Opening an OGR data source without specifying the tables to open was extremely slow with our in house server.
I did some performance profiling and found that most of the time was spent in OGROCIDataSource::OpenTable(). More specifically, the time was spent waiting on the database queries in OGROCITableLayer::ReadTableDefinition() and OGROCILayer::LookupTableSRID().
I decided to trace an Oracle session to see why the queries were taking so long, I discovered that most of the time was spent in the parse stage of the query, not in the execution.
Oracle has a shared pool to cache to execution plans of queries, but it usually gets hit if the queries are exactly the same.
This improvement is to update the functions above to use bind variables so that the queries can be parsed for the first table, and just executed for the following tables, resulting in much better performance.