[Qgis-user] Adding layer slows down QGIS dramatically after adding a layer

Richard McDonnell richard.mcdonnell at opw.ie
Mon Aug 17 00:51:53 PDT 2020


Hi Peter,
One further thing you could try, if not already done, is to create Spatial Index’s.
You can do this within QGIS under the Layer Properties, by going to the Source tab and selecting, Create Spatial Index.

See: https://medium.com/@wherelytics/understanding-spatial-indexes-in-ogc-geopackage-files-9960fdf71f82

Hope this helps

Richard.






——
Richard McDonnell MSc GIS, FME Certified Professional
FRM Data Management

——
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
——
M +353 87 688 5964 T +353 1 647 6543
https://www.opw.ie

——
To send me files larger than 30MB, please use the link below https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie

Email Disclaimer: https://www.opw.ie/en/disclaimer/
From: Qgis-user <qgis-user-bounces at lists.osgeo.org> On Behalf Of Peter Cornelissen
Sent: 14 August 2020 00:19
To: rdmailings at duif.net
Cc: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] Adding layer slows down QGIS dramatically after adding a layer

Hi Richard

Thanks for the suggestion. They are plain filters and I tried indexing every table, but unfortunately it has made no noticeable difference.

Regards, Peter

On Thu, 13 Aug 2020 at 15:35, Richard Duivenvoorde <rdmailings at duif.net<mailto:rdmailings at duif.net>> wrote:
On 8/13/20 3:57 PM, Peter Cornelissen wrote:
> Hi
>
> I am using a Geopackage with about 15 tables (a mixture of lines, polygons and points), but each of these tables are
> used 40 or 50 times with filters as many of the elements are used on multiple layers.
> However, I am now finding that as soon as I add a new layer QGIS slows down
> and it is taking 60 seconds or more to do almost any action that involves
> redrawing (zoom in/out/ pan etc) or even moving a layer within the layers
> panel. If I save the project, close down QGIS and restart, it is fine again
> until the next time.
>
> Any suggestions?
>
> Thanks, Peter

Looking at the attributes which are used in the filters, add 'indexes' too the tables in the Geopackage?

In QGIS you can do that by creating a connection to the gpkg with DataBase Manager and then:
 'edit table' > tab indexes, > add index

A geopackage is a sqlite database, so if you have some sql-client (DB-manager, DB-browser) you can fire the create index query there:
CREATE INDEX "foo_index" ON "mygeopackage" ("foo_column")

Note that these are plain indexes, no spatial ones.
IF your filters are spatial filters, then off course you need spatial indexes.

HTH

Regards,

Richard Duivenvoorde
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20200817/a50a0cce/attachment.html>


More information about the Qgis-user mailing list