In QGIS I have a virtual layer which does a line generation based on a point shape. The point shape has about 700 point geometries and 26 attribute fields.

SELECT  a.Name, a.FromNode, a.ToNode, a.Length, a.Roughness, 
        a.InOffset, a.OutOffset, a.InitFlow, a.MaxFlow, a.Shape, 
        a.Geom1, a.Geom2, a.Geom3, a.Geom4, a.Barrels, a.Culvert, 
        a.Shp_Trnsct, a.Kentry, a.Kexit, a.Kavg, a.FlapGate, 
        a.Seepage, a.Annotation, a.Variante, 
        makeline(a.geometry, b.geometry) AS geometry 
FROM pointshape a, pointshape b 
WHERE b.Name = a.ToNode

Unfortunately the resulting virtual polyline layer ist quite slow on rendering and espacially on opening the attribute table. I need the virtual polylines to run on the point layer, because I want to edit only the point layer. If I do the same on a temporal scratch layer there are no peferormance issues.

  • What software is this? Can you add a tag for it and maybe mention it in the title?
    – Spacedman
    Oct 24, 2023 at 12:36
  • I've edited the question - thanks!
    – MtoK
    Oct 24, 2023 at 12:47
  • Virtual layers are often slow. Can you export the result to a geopackage?
    – BERA
    Oct 24, 2023 at 13:06
  • A bit more context would help. What do you need the virtual layer (the lines) for? Visualization only? Geoprocessing? Could you only run the makeline part, without loading the attributes, save the lines and then join attributes by location? A lot of different workflows are possible, but depending on what you want to achieve.
    – Babel
    Oct 24, 2023 at 14:47
  • 2
    What file formats are your source layers? Oct 24, 2023 at 15:07

1 Answer 1


Okay, the solution (thanks @bugmenot123, @Babel for the hints) was to save the pointlayer as geopackage. Originally it was ESRI-Shape. Switching to geopackage will speed up rendering the virtual polylines and opening the attributetable way much faster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.