[QGIS-Developer] QGIS "fast" mode

Tomas Straupis tomasstraupis at gmail.com
Sat Mar 14 04:55:25 PDT 2020


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

-- 
Tomas


More information about the QGIS-Developer mailing list