[QGIS-Developer] Postgis loading using COPY instead of INSERTS?

RĂ©gis Haubourg regis.haubourg at gmail.com
Fri May 19 00:04:30 PDT 2017

Forwarding Nyall tips, might be usefull for others

> I tested drag and drop in browser and dbmanager (in 2.18.7 and master) and
> couldn't find anything about that in the issues or the code base.

Both of these codepaths use QgsVectorLayerExporter, which batches
calls to QgsVectorDataProvider::addFeatures in groups of 200 features.
So there's definitely the potential for a good speed bump here by
moving to the COPY command.

> Did I miss something? Is there someone working in that area?

I don't think so. The tricky bit would be handling the "RETURNING"
part of the INSERT command, which is used to update the add features
with their new feature IDs/primary keys. I'm not sure that's possible
using a COPY command.

View this message in context: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-Postgis-loading-using-COPY-instead-of-INSERTS-tp5320528p5321038.html
Sent from the QGIS - Developer mailing list archive at Nabble.com.

More information about the QGIS-Developer mailing list