[QGIS-Developer] QGIS virtual layer incredibly slow

Totò Fiandaca pigrecoinfinito at gmail.com
Thu May 2 02:14:54 PDT 2019


Hello everyone,
I use virtual layers a lot and confirm the slowness and the continuous
updating that makes the tool almost unusable.

it would be very useful to speed things up.

thank you

Il giorno gio 2 mag 2019 alle ore 11:02 Andreas Neumann <a.neumann at carto.net>
ha scritto:

> Hi,
>
> One of my colleagues created a QGIS project where they loaded a parcel
> layer with approx. 24000 polygons (data source Postgis) and another layer
> with 3 polygons representing project perimeters of contruction sites. That
> second layer is in a Geopackage.
>
> Now they want to select all parcels that are intersecting the project
> perimeters.
>
> The query is straightforward:
>
> SELECT lie.nummer_grundstueck, lie.gemeinde, tbap.bemerkungen, lie.geometry
> FROM lie_liegenschaft lie, tba_projektperimeter tbap
> WHERE ST_Intersects(lie.geometry, tbap.geometry)
>
> Now the problem is: this query (24000 parcels, 3 project perimeters) is
> just incredibly slow: about 40 seconds. In a Postgis view this would be way
> less then a second! The worst thing: that virtual layer is updated with
> each and every zoom and pan. Is there no way to cache a virtual layer?
>
> Can I do something to speed up our virtual layer? The parcel layer only
> chanes once a month and the perimeters only occasionally, so it would be
> best to cache the result within a QGIS session, because there are no
> changes in the geometries of both layers expected.
>
> I understand that virtual layers somehow have to transfer all data formats
> (through ogr) into SpatiaLite or SQLite to do the query, but this is really
> way too slow for real world usage in my opinion (unless I do something
> wrong in our query).
>
> If you have any ideas how to speed up virtual layers in QGIS it would be
> much appreciated.
>
> Thanks,
> Andreas
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



-- 
*Ing. Salvatore Fiandaca*
*mobile*.:+39 327.493.8955
*m*: *pigrecoinfinito at gmail.com <pigrecoinfinito at gmail.com>*
*C.F*.: FNDSVT71E29Z103G
*P.IVA*: 06597870820
*membro QGIS Italia - http://qgis.it/ <http://qgis.it/>*
*socio GFOSS.it - *http://gfoss.it/
*blog:*
* https://pigrecoinfinito.wordpress.com/
<https://pigrecoinfinito.wordpress.com/> FB: Co-admin
- https://www.facebook.com/qgis.it/ <https://www.facebook.com/qgis.it/>**
<https://www.facebook.com/qgis.it/> *
*TW:  <http://goog_95411464>**https://twitter.com/totofiandaca
<https://twitter.com/totofiandaca>*

43°51'0.54"N  10°34'27.62"E - EPSG:4326

“Se la conoscenza deve essere aperta a tutti,
perchè mai limitarne l’accesso?”
R. Stallman

Questo documento, allegati inclusi, contiene informazioni di proprietà di
FIANDACA SALVATORE e deve essere utilizzato esclusivamente dal destinatario
in relazione alle finalità per le quali è stato ricevuto. E' vietata
qualsiasi forma di riproduzione o divulgazione senza l'esplicito consenso
di FIANDACA SALVATORE. Qualora fosse stato ricevuto per errore si prega di
informare tempestivamente il mittente e distruggere la copia in proprio
possesso.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190502/e9fc903e/attachment.html>


More information about the QGIS-Developer mailing list