[QGIS-trac] Re: [Quantum GIS] #1855: Postgis View Layers with OID
as primary key are loading very slow
Quantum GIS
qgis at qgis.org
Thu Aug 6 07:45:55 EDT 2009
#1855: Postgis View Layers with OID as primary key are loading very slow
-------------------------------------+--------------------------------------
Reporter: hdus | Owner: jef
Type: bug | Status: new
Priority: minor: annoyance | Milestone: Version 1.2.0
Component: Data Provider | Version: HEAD
Resolution: | Keywords:
Platform_version: | Platform: All
Must_fix: Yes | Status_info: 0
-------------------------------------+--------------------------------------
Comment (by hdus):
Replying to [comment:3 jef]:
> Replying to [ticket:1855 hdus]:
> > 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 #1535
Loading means inserting. I took a look at the comments of #1535 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?
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1855#comment:4>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list