<div dir="auto">Hi Tomas. <div dir="auto">Check the project property option named "trust". This is exactly what it is supposed to do. </div><div dir="auto">I admit the wording is not nice, any better idea is welcome. </div><div dir="auto">Best regards</div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le sam. 14 mars 2020 à 12:55, Tomas Straupis <<a href="mailto:tomasstraupis@gmail.com">tomasstraupis@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello<br>
<br>
  I would like to know opinion of QGIS developer community on the<br>
question of "self-fixing queries" in the context of database layers.<br>
<br>
  When you add a new database layer, QGIS queries required data, asks<br>
user for other information and then saves it in the project file.<br>
  Now when you re-open the project, QGIS is re-querying a lot of data<br>
which is already saved in the project: geometry type, srid, attributes<br>
(table columns/types).<br>
  The downsides are:<br>
  * these "re-checking" queries take considerable time on large<br>
databases: with millions of records from 1minute up to several hours,<br>
database is tuned - WMS/WFS queries finish in ~100ms.<br>
  * in QGIS server environment these re-checking queries are executed<br>
each time when apache launches a new QGIS server process<br>
  * QGIS might by itself (without human interaction) decide to  work<br>
differently compared to what it was asked to do when the project was<br>
created if it finds that "something has changed"<br>
  * re-checking during project opening is not 100% correct, as if<br>
changes are possible in principle, then data/schema could change<br>
during the time QGIS (Desktop/Server) is open/running<br>
  * in environments other than development (testing, qa, production),<br>
database schema should never change without some clear procedure which<br>
should also include updating QGIS project files and testing them as<br>
required, therefore such re-checkings should never be required on<br>
testing/production environments.<br>
<br>
  I do understand that the current situation/understanding is<br>
different from mine, so in order to satisfy everybody, maybe it would<br>
be feasible to add say an environment variable like QGIS_FAST=TRUE (or<br>
QGIS_PRODUCTION=TRUE) and if this is set - re-checking queries could<br>
be skipped? We've been running modified QGIS without re-checking in<br>
production for months and are very happy with results. This should<br>
also improve the benchmarks of QGIS Server as it is known that initial<br>
opening of the project takes considerable amount of time.<br>
<br>
  What is your opinion?<br>
<br>
  Thank you<br>
<br>
-- <br>
Tomas<br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote></div>