- It is safest to operate only on SQLite files on a physical disk of the local system
- SQLite is a Transactional DBMS; while many INSERT statements are executed in close sequence, BEGIN TRANSACTION and COMMIT TRANSACTION statements have to be invoked appropriately in order to get optimal performance.
- The default OGR behavior is to COMMIT a transaction every 200 inserted rows. This value is surely too low for SQLite; and closing too much frequently the current transaction causes severe performance degradation. The -gt argument allows to explicitly set the number of rows for each transaction. Explicitly defining -gt 1024 usually ensures a noticeable performance boost; defining an even bigger -gt 65536 ensures optimal performance while populating some table containing many hundredth thousand or million rows.
- Explicitly setting a much more generously dimensioned internal Page Cache may often help to get a noticeably better performance. Starting since GDAL 1.9.0 you can explicitly set the internal Page Cache size using the configuration option OGR_SQLITE_CACHE value [value being measured in MB]; if your HW has enough available RAM, defining a Cache size as big as 512MB (or even 1024MB) may sometimes help a lot in order to get better performance.
- Setting the OGR_SQLITE_SYNCHRONOUS configuration option to OFF might also increase performance when creating SQLite databases (altough at the expense of integrity in case of interruption/crash ).
Tuesday, March 5, 2013
Sqlite trivials
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment