Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgis View Layers with OID as primary key are loading very slow #11915

Closed
qgib opened this issue Aug 3, 2009 · 6 comments
Closed

Postgis View Layers with OID as primary key are loading very slow #11915

qgib opened this issue Aug 3, 2009 · 6 comments
Labels
Data Provider Related to specific vector, raster or mesh data providers Feature Request
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Aug 3, 2009

Author Name: Horst Düster (@hdus)
Original Redmine Issue: 1855

Redmine category:data_provider
Assignee: Jürgen Fischer


I want to load a postgis view layer defined in a way that the OID represents the primary key of the view query result. No real primary key is defined in the source tables. When I query this view from psql it gives me the query result very fast. When I load this layer into QGIS it needs a very long time, more than 1 minute, to load this layer.


@qgib
Copy link
Contributor Author

qgib commented Aug 3, 2009

Author Name: Giovanni Manghi (@gioman)


Hi,

what version of qgis are you using? platform?

@qgib
Copy link
Contributor Author

qgib commented Aug 3, 2009

Author Name: Horst Düster (@hdus)


svn cbf7cf6 (SVN r11253)
kubuntu 9.04
postgres 8.4.0

@qgib
Copy link
Contributor Author

qgib commented Aug 3, 2009

Author Name: Jürgen Fischer (@jef-n)


Replying to "hdus":/issues/show/1855:

I want to load a postgis view layer defined in a way that the OID represents the primary key of the view query result. No real primary key is defined in the source tables. When I query this view from psql it gives me the query result very fast. When I load this layer into QGIS it needs a very long time, more than 1 minute, to load this layer.

Does "loading" mean only "inserting" or "displaying"? Inserting the view to the project can be slow, while QGIS tries to figure out what the primary key column is. Once that's done displaying should be quick. Saving the project and reloading it should be also quick as QGIS saves the key column it found.

If you add the layer using python you can also specify the key column using key=column and QGIS will just verify that it's unique.

See also #11595

@qgib
Copy link
Contributor Author

qgib commented Aug 6, 2009

Author Name: Horst Düster (@hdus)


Replying to [comment:3 jef]:

Replying to "hdus":/issues/show/1855:

I want to load a postgis view layer defined in a way that the OID represents the primary key of the view query result. No real primary key is defined in the source tables. When I query this view from psql it gives me the query result very fast. When I load this layer into QGIS it needs a very long time, more than 1 minute, to load this layer.

Does "loading" mean only "inserting" or "displaying"? Inserting the view to the project can be slow, while QGIS tries to figure out what the primary key column is. Once that's done displaying should be quick. Saving the project and reloading it should be also quick as QGIS saves the key column it found.

If you add the layer using python you can also specify the key column using key=column and QGIS will just verify that it's unique.

See also #11595

Loading means inserting. I took a look at the comments of #11595 and there gjm talked about an option to select the primary key column by the user when he is loading the postgis layer. Maybe it is possible to make some changes of the Postgis loader UI in this direction?

@qgib
Copy link
Contributor Author

qgib commented Aug 12, 2009

Author Name: Horst Düster (@hdus)


Replying to [comment:5 jef]:

Thank you for the patch. Yes in this way it works fine for me!

@qgib
Copy link
Contributor Author

qgib commented Aug 22, 2009

Author Name: Jürgen Fischer (@jef-n)


applied in d6134d5 (SVN r11480)


  • resolution was changed from to fixed
  • status_id was changed from Open to Closed

@qgib qgib added Feature Request Data Provider Related to specific vector, raster or mesh data providers labels May 24, 2019
@qgib qgib added this to the Version 1.3.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Provider Related to specific vector, raster or mesh data providers Feature Request
Projects
None yet
Development

No branches or pull requests

1 participant