[Qgis-user] Geopackage slow on NAS if not read-only

Neil B osgeo+qgis at benneb.ca
Fri Mar 24 22:35:32 PDT 2023


I suspect the biggest reason for the difference in performance between
opening the GPKG in RO mode and RW mode (file system level) is the creation
of the -wal and its partner the -shm temporary files. Information about
temporary files created when using GPKG is on this link
https://www.sqlite.org/tempfiles.html as the underlying DB is sqlite.

When you open a GPKG, meaning you are accessing data from the file, the
-wal file and its partner the -shm file are created in the same directory
as the GPKG file. The WAL file is created to implement atomic commit and
rollback. At the file system level, if you place the GPKG in read only mode
then there is never a concern about writing data to the database so the
-wal and -shm temp files are not created. The behaviour of the temporary
files has nothing to do whether the layer is put in edit mode or not, but
is a functionality of SQLite.

You don't have the speed problem with shapefiles as they have no mechanism
to protect them from multiple users and no mechanism to ensure the
equivalent of an atomic commit. If multiple people make edits to the same
shapefile, the last one to save is the one that decides what is written,
assuming the shapefile doesn't get corrupted in the mean time.

Cheers!
~Neil B.

On Wed, Mar 15, 2023 at 1:31 PM Árni Geirsson via QGIS-User <
qgis-user at lists.osgeo.org> wrote:

> Hello all QGIS and geopackage users.
> I store my geopackages on a Synology RackStation NAS unit, like all other
> documents that are kept on a shared drive in the office. For larger
> datasets, the rendering is very slow, unless I open the properties dialog
> for the file in Windows and check the read only box. After that, the
> features are rendered blazingly fast. Nothing else is changed to see the
> dramatic difference in the rendering speed. Luckily, I don't need to edit
> many of the larger datasets, such as road networks and elevation contours
> and the geopackage can be kept read only. Shapefiles are not affected.
> What explains this and does anyone know how to solve the problem?
> Do other users experience this?
>
> Árni Geirsson
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230324/5129d3f7/attachment.htm>


More information about the QGIS-User mailing list