[QGIS-Developer] QGIS "fast" mode

Richard Duivenvoorde rdmailings at duif.net
Sat Mar 14 05:11:57 PDT 2020


Related: having projects with several WMS or WFS server layers also are
opening very slowly (even when NOT visible). It would be nice to have
'lazy' loading, so only load layer which are visible?

@Tomas: are you sure it is doing full table scans? Most database have
some 'metadata' or cached metadata tables which could be used for that.


Richard Duivenvoorde

On 3/14/20 12:55 PM, Tomas Straupis wrote:
> Hello
>   I would like to know opinion of QGIS developer community on the
> question of "self-fixing queries" in the context of database layers.
>   When you add a new database layer, QGIS queries required data, asks
> user for other information and then saves it in the project file.
>   Now when you re-open the project, QGIS is re-querying a lot of data
> which is already saved in the project: geometry type, srid, attributes
> (table columns/types).
>   The downsides are:
>   * these "re-checking" queries take considerable time on large
> databases: with millions of records from 1minute up to several hours,
> database is tuned - WMS/WFS queries finish in ~100ms.
>   * in QGIS server environment these re-checking queries are executed
> each time when apache launches a new QGIS server process
>   * QGIS might by itself (without human interaction) decide to  work
> differently compared to what it was asked to do when the project was
> created if it finds that "something has changed"
>   * re-checking during project opening is not 100% correct, as if
> changes are possible in principle, then data/schema could change
> during the time QGIS (Desktop/Server) is open/running
>   * in environments other than development (testing, qa, production),
> database schema should never change without some clear procedure which
> should also include updating QGIS project files and testing them as
> required, therefore such re-checkings should never be required on
> testing/production environments.
>   I do understand that the current situation/understanding is
> different from mine, so in order to satisfy everybody, maybe it would
> be feasible to add say an environment variable like QGIS_FAST=TRUE (or
> QGIS_PRODUCTION=TRUE) and if this is set - re-checking queries could
> be skipped? We've been running modified QGIS without re-checking in
> production for months and are very happy with results. This should
> also improve the benchmarks of QGIS Server as it is known that initial
> opening of the project takes considerable amount of time.
>   What is your opinion?
>   Thank you

More information about the QGIS-Developer mailing list