<div dir="ltr"><div dir="ltr"><div class="gmail_default"><div class="gmail_default"><font face="garamond, serif" size="4">Hello everyone,</font></div><div class="gmail_default"><font face="garamond, serif" size="4">I use virtual layers a lot and confirm the slowness and the continuous updating that makes the tool almost unusable.</font></div><div class="gmail_default"><font face="garamond, serif" size="4"><br></font></div><div class="gmail_default"><font face="garamond, serif" size="4">it would be very useful to speed things up.</font></div><div class="gmail_default"><font face="garamond, serif" size="4"><br></font></div><div class="gmail_default"><font face="garamond, serif" size="4">thank you</font></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 2 mag 2019 alle ore 11:02 Andreas Neumann <<a href="mailto:a.neumann@carto.net">a.neumann@carto.net</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  

    
  
  <div bgcolor="#FFFFFF">
    <p>Hi,</p>
    <p>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.<br>
    </p>
    <p>Now they want to select all parcels that are intersecting the
      project perimeters.</p>
    <p>The query is straightforward:</p>
    <p><tt><span style="font-size:10pt">SELECT lie.nummer_grundstueck,
          lie.gemeinde, tbap.bemerkungen, lie.geometry</span></tt><tt><span style="font-size:10pt" lang="EN-US"><br>
          FROM lie_liegenschaft lie, tba_projektperimeter tbap<br>
          WHERE ST_Intersects(lie.geometry, tbap.geometry)</span></tt></p>
    <p><span style="font-size:10pt" lang="EN-US">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?</span></p>
    <p><span style="font-size:10pt" lang="EN-US">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.</span></p>
    <p><span style="font-size:10pt" lang="EN-US">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).</span></p>
    <p><span style="font-size:10pt" lang="EN-US">If you have any ideas
        how to speed up virtual layers in QGIS it would be much
        appreciated.</span></p>
    <p><span style="font-size:10pt" lang="EN-US">Thanks,<br>
        Andreas<br>
      </span></p>
    <span style="font-size:10pt;font-family:Arial,sans-serif" lang="EN-US"></span>
  </div>

_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font size="2"><font face="garamond, serif"><b>Ing. Salvatore Fiandaca</b><br><b>mobile</b>.:+39 327.493.8955 <br><b>m</b>: <b><a href="mailto:pigrecoinfinito@gmail.com" target="_blank">pig<span></span><span></span>recoinfinito@gmail.com</a></b></font></font></div><div><font face="garamond, serif" size="2"><b>C.F</b>.: FNDSVT71E29Z103G</font></div><div><font face="garamond, serif" size="2"><b>P.IVA</b>: 06597870820</font></div><div><font face="garamond, serif" size="2"><b>membro QGIS Italia - <a href="http://qgis.it/" target="_blank">http://qgis.it/</a></b><br><b>socio GFOSS.it - </b><a href="http://gfoss.it/" style="font-weight:bold" target="_blank">http://gfoss.it/</a></font></div><div><font face="garamond, serif" size="2"><b>blog:</b><b><a href="https://pigrecoinfinito.wordpress.com/" target="_blank"> https://pigrecoinfinito.wordpress.com/</a> <br>FB: Co-admin - <a href="https://www.facebook.com/qgis.it/" target="_blank">https://www.facebook.com/qgis.it/</a></b></font><b style="font-family:garamond,serif;font-size:small"><a href="https://www.facebook.com/qgis.it/" target="_blank"> </a> </b></div><div><b style="font-family:garamond,serif;font-size:small">TW:<a href="http://goog_95411464" target="_blank"> </a></b><font face="garamond, serif" size="2"><b><a href="https://twitter.com/totofiandaca" target="_blank">https://twitter.com/totofiandaca</a></b></font></div><div><font face="garamond, serif" size="2"><br></font></div><div dir="ltr"><font face="garamond, serif"><font size="2">43°51'0.54"N  10°34'27.62"E - EPSG:4326</font></font></div><div dir="ltr"><font face="garamond, serif"><font size="2"><br></font></font></div><div dir="ltr"><font face="garamond, serif"><font size="2">“Se la conoscenza deve essere aperta a tutti,</font></font></div><div dir="ltr"><font face="garamond, serif"><font size="2">perchè mai limitarne l’accesso?” </font></font></div><div dir="ltr"><font face="garamond, serif"><font size="2">R. Stallman<br><br></font></font><span style="font-family:"Trebuchet MS";font-size:10px">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 </span><span style="font-family:"Trebuchet MS";font-size:10px">FIANDACA SALVATORE</span><span style="font-family:"Trebuchet MS";font-size:10px">.</span><span style="font-family:"Trebuchet MS";font-size:10px"> Qualora fosse stato ricevuto per errore si prega di informare tempestivamente il mittente e distruggere la copia in proprio possesso.<br></span><font face="garamond, serif"><font size="2"><br><br></font></font></div><div dir="ltr"><font face="garamond, serif"><font size="2"></font></font></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>