Bug report #8334

"Save selection as" is slow from large PostGIS table

Added by Nyall Dawson over 11 years ago. Updated about 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Vectors
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:17122

Description

Steps to reproduce:

1. Load a large PostGIS table (containing millions of points)
2. Select a single feature
3. Right click layer, choose "Save Selection As"
4. Choose filename and options

QGIS takes a very long time to export this single point. It seems to take even longer than it does to load the entire PostGIS table into QGIS.

Expected result:
Since only a single point feature is selected, the selection would be saved almost instantaneously.

Associated revisions

Revision f0d31b03
Added by Nyall Dawson about 9 years ago

Use a FilterFids request for vector file writer rather than fetching
all features and then testing the feature id when saving selected
features

For providers such as Postgres this is orders of magnitude faster.
Eg, saving 6 selected features from a 800k PostGIS table now
takes < 1 second as opposed to ~33 seconds

Fix #8334

Revision 57381f49
Added by Nyall Dawson about 9 years ago

Use a FilterFids request for vector file writer rather than fetching
all features and then testing the feature id when saving selected
features

For providers such as Postgres this is orders of magnitude faster.
Eg, saving 6 selected features from a 800k PostGIS table now
takes < 1 second as opposed to ~33 seconds

Fix #8334

(cherry-picked from f0d31b03a9bbc1d43e1b51ccd4acf64cf2616a63)

History

#1 Updated by Nyall Dawson about 9 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF