[QGIS-trac] Re: [Quantum GIS] #1855: Postgis View Layers with OID
as primary key are loading very slow
Quantum GIS
qgis at qgis.org
Mon Aug 3 10:54:06 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
-------------------------------------+--------------------------------------
Changes (by jef):
* owner: mhugent => jef
Comment:
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
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1855#comment:3>
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