Open rldhont opened 4 years ago
Open for feedback @andreasneumann @pblottiere @elpaso @mdouchin @dmarteau
Thanks for the work. What about proposing a solution to disable also:
The checking of every feature field type and other properties: let's really trust the project here too ?
Btw. don't miss the recent speedup here: https://github.com/qgis/QGIS/pull/38158 . With only checking the relevant fields, it works smoothly in large databases in the end.
The checking of every feature field type and other properties: let's really trust the project here too ?
Btw. don't miss the recent speedup here: qgis/QGIS#38158 . With only checking the relevant fields, it works smoothly in large databases in the end.
Thanks @borysiasty. this is for postgres layers. Does the same has been done for oracle or other database ?
The trust flag only skips the extent request to the provider. For you what are the other requests to skip with this flag ?
To enhance the trust flags: Propagate trust layer metadata flag https://github.com/qgis/QGIS/pull/38464
Thanks @borysiasty. this is for postgres layers. Does the same has been done for oracle or other database ?
Nope. I only touched the Postgres provider. I guess that particular issue with fetching superfluous metadata was postgres-specific.
QGIS Enhancement: Improve QGIS project loading time - mainly for QGIS Server
Date 2020/06/03
Author DHONT René-Luc (@rldhont)
Contact rldhont at 3liz dot com
maintainer @rldhont
Version QGIS 3.16
Summary
The
trust
project option was created to try to improve the loading time of a QGIS project for thepostgres
layers.This option forced 2 things for the
postgres
layers: not checking the uniqueness of the primary key and using the extent of the layer defined in the project.Since QGIS 3, the
trust
option forces the use of the layer extent defined in the project for all vector layers and modifies thecheckPrimaryKeyUnicity
parameter of the Datasource of thepostgres
layers.There is also for some layers a Datasource parameter
useEstimatedMetadata
allowing to accelerate the retrieval of information on the layer (grip, feature count, layer type, etc).To improve the loading of a QGIS project, you should:
mReadExtentFromXml
useEstimatedMetadata
,checkPrimaryKeyUnicity
, etc.checkGeometryType
,checkSrid
, etc.Some providers will be more impacted than others like
postgres
andoracle
.Proposed Solution
Extend the use of the extent defined in the project
For vector layers, we have:
We would have to add
readExtentFromXml
toQgsRasterLayer::LayerOptions
struct, a private attributemReadExtentFromXml
and make the code to take it into account inQgsRasterLayer
.Management interface
In the Layer Properties window, in the Source tab, we must add a management interface for the extent defined in the project, but also for Datasource parameters such as
useEstimatedMetadata
andcheckPrimaryKeyUnicity
.Management of the extent defined in the project
If it is possible to use the extent defined in the project for all the layers, it is necessary to be able to manage this extent.
For the moment QGIS only offers a button to calculate the extent of the layer from the data.
This extent can evolve by adding data, it would therefore be necessary for certain layers to regularly recalculate this extent or define a maximum extent integrating the maximum of data.
We propose to define an interface displaying the current extent as for the extent of the CRSes and the values of this extent.
We also propose to define several buttons allowing to carry out the following operations and reuse
QgsExtentWidget
:Managing Datasource settings
Datasource parameters can no longer be modified once the layer has been created:
useEstimatedMetadata
to activate the use of the estimated metadata tablecheckPrimaryKeyUnicity
.selectAtIdDisabled()
Define new parameters to speed up the loading of layers
By studying the source codes of providers
postgres
andoracle
, it is possible to define new Datasource parameters that would improve the loading of the project:checkGeometryType
, checking the geometry type from the data sourcecheckSrid
, checking the coordinate system from the data sourceExample(s)
(optional)
Affected Files
Extend the use of the extent defined in the project
Management interface
Define new parameters to speed up the loading of layers
Performance Implications
Hope to speed up the loading of layers
Further Considerations/Improvements
Better managing layer's datasource
Backwards Compatibility
none
Votes
(required)