Opened 17 years ago

Closed 17 years ago

Last modified 15 years ago

#477 closed bug (fixed)

Loading a PostGIS View is very slow

Reported by: horst.duester@… Owned by: g_j_m
Priority: critical: causes crash or data corruption Milestone:
Component: Vectors Version: Trunk
Keywords: Cc:
Must Fix for Release: Yes Platform: RedHat
Platform Version: Awaiting user input: no

Description

The loading of a PostGIS view is much slower than the loading of a table with the same structure.

The simple view CREATE OR REPLACE VIEW geo_gemeinden_v AS

SELECT oid, ogc_fid, wkb_geometry, name, gem_bfs, gmde_name, gmde_nr, bzrk_nr, eg_nr, plz, ktn_nr, new_date, archive_date, archive FROM geo_gemeinden;

needs 24secs to load. The table geo_gemeinden with the same structure less than 1sec.

For testing purposes I attach the dump of geo_gemeinden

Change History (11)

comment:1 by horst.duester@…, 17 years ago

Please excuse but the mentioned file could not be attached due to size.

comment:2 by anonymous, 17 years ago

Component: Build/InstallOGR Layer support

comment:3 by g_j_m, 17 years ago

Milestone: Version 0.8 ReleaseVersion 0.9 Release

Qgis has to do a lot more work when loading views. It has to work out which table/column each column in the view comes from, and then choose a column to use as a unique key. This entails working out that information for all views in the database. If you have a lot of views in the database, this may take some time.

Nothwithstanding all of that, 24 seconds is a lot longer than 1 second, and this area clearly needs some more work, but it's unlikely to happen before we release 0.8.

comment:4 by horst.duester@…, 17 years ago

Now release 0.8 is released and I want to ask for the state of solution. My DB has more than 300 Geo-Layers and much more Geo-Views. QGIS takes a very long time to load a view.

comment:5 by anonymous, 17 years ago

Owner: changed from nobody to g_j_m

comment:6 by g_j_m, 17 years ago

A potential speed-up has been committed to head (r6610). Please test if you can. If it works, I'll port it to the 0.8.1 branch.

comment:7 by g_j_m, 17 years ago

Hmm. It's actually slower :(

comment:8 by horst.duester@…, 17 years ago

Awaiting user input: unset
Priority: majorblocker
Type: enhancementbug

I'll come back to my qustion about the state of solution. The slowness of views is a real and essential problem. I'm not able to use QGIS in our enterprise environment due to the view problem.

Horst Duester SO!GIS Kanton Solothurn

comment:9 by g_j_m, 17 years ago

Nothing more has been done about this. I'd actually forgotten about it! I'll have another go this weekend.

Gavin

comment:10 by mhugent, 17 years ago

Component: OGR Layer supportVectors
Resolution: fixed
Status: newclosed

A fix for this is in r7071. It also adresses column renaming with 'AS' and views that refer to other views.

comment:11 by (none), 15 years ago

Milestone: Version 0.9

Milestone Version 0.9 deleted

Note: See TracTickets for help on using tickets.