[QGIS-Developer] QGIS virtual layer incredibly slow

matteo matteo.ghetta at gmail.com
Thu May 2 03:51:21 PDT 2019


Hi Andreas,

> Seems like I am not the only one that suffers from this slowness.

not at all!

> The same query that takes about 40 secs in a virtual layer runs in 200ms
> in Postgis. Now I know that there is a lot of overhead to bring the two
> different data sources (Postgis and Geopackage) together, but it still
> doesn't explain the 40 secs.

as I wrote in the last mail, it happens also if the query is run on one
single layer (no matter if shp or geopackage)

> So if there would be some potential to introduce a caching mechanism to
> QGIS virtual layers, it would be much appreciated. There could be
> several update strategies: on opening of the project, on manual update
> (right-click layer --> update) or time based (e.g. every 5 minutes), or
> event based (if one of the involved layers changes).

I might be super wrong, but AFAIK, virtual layers behave like db views.
Is there any chance to change this behavior and make as materialized
views? So it is up to the user to update the virtual layer when needed.

Cheers

Matteo


More information about the QGIS-Developer mailing list