[QGIS-Developer] qgis_editor_widget_styles table, what is it ? How to create it?
Nyall Dawson
nyall.dawson at gmail.com
Fri May 24 20:33:22 PDT 2019
On Fri, 24 May 2019 at 18:25, RĂ©gis Haubourg <regis.haubourg at gmail.com> wrote:
>
> Hi all,
> I'm facing very slow opening of project files for a customer here in QGIS 3.4.5. Something like 7 minutes, against 30 s in QGIS 2.18.
>
> We are still investigating to narrow it down, but I faced a first query in the logs that I fail to understand.
>
> QGIS emits this at a point:
>
> And this query is long in our context, 1.7s, because of a very high number of tables and schemas in that production DB.
>
> I found at [0] in the postgres provider where it comes from, I found the associated PR [1], but I fail to understand in what workflow this table is created using QGIS, and what it is used for.
>
> Can someone put some light here ?
There's a unit test at
https://github.com/qgis/QGIS/pull/3439/files#diff-99b101819133a316786604243f3abf6eR318
and
https://github.com/qgis/QGIS/pull/3439/files#diff-03e6d7f6f76fb4bcab508984d0fd05f6R443
which partially explains this -- it looks like it's a way to specify a
default editor widget configuration for a table, which is used
whenever that table is loaded into QGIS.
>
> select count(*)
>
> from information_schema.tables
>
> where table_name = 'qgis_editor_widget_styles' ;
>
Looks like that query could be substantially improved -- it's only
testing for existence of the table, so calculating the count is
inefficient and requiring a whole table scan.
Nyall
More information about the QGIS-Developer
mailing list