[gdal-dev] Writing to SQLite is very slow
Roald de Wit
rdewit.list at somethingspatial.com.au
Mon Jan 18 06:23:07 EST 2010
Hi Even,
Thanks for this. Crschmidt *did* mention the transactions and I guess it
would work if I were to create an empty layer and walk through the
features one by one.
I was hoping to use the 'CopyLayer' method of a DataSource (for
simplicity's sake). It seems that you can provide options to it. Is
there an option to tell it to use transactions?
Regards, Roald
Even Rouault wrote:
> Roald,
>
> You should try using transactions as suggested on IRC. This does make a lot of
> difference for SQLite.
>
> if 'lyr' is the Python object for your SQLite layer :
>
> lyr.StartTransaction()
>
> ... insert features ....
>
> lyr.CommitTransaction()
>
> Best regards,
>
> Even
>
> Le Monday 18 January 2010 06:32:47 Roald de Wit, vous avez écrit :
>
>> Hi list,
>>
>> Whilst trying to mimic ogr2ogr functionality in Python, I stumbled upon
>> an issue with writing to SQLite: it works, but it's painfully slow
>> (minutes instead of seconds).
>>
>> The link below points to an example that can be used for reproducing the
>> behaviour:
>> http://rdewit.pastebin.com/f73c9b3c0
>>
>> Outputting to ESRI Shapefile, or another CSV is very fast. It's only
>> SQLite that seems to be slow.
>>
>> Any idea what I'm doing wrong?
>>
>> Regards, Roald
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>
>
More information about the gdal-dev
mailing list