Re: [Qgis-user] QGIS-Server How to avoid unique data check in postgis for each session

2022-11-16 Thread Amedeo Fadini via Qgis-user
Thank-you very much Jurgen, it works.
I found that in the .qgs file it an attribute "estimatedmetadata=true" on
ayer-tree-layer and datsource element.
Wonder if checkPrimaryKeyUnicity='1' on the same elements does mean
anything...

Amedeo

Il giorno mer 16 nov 2022 alle ore 15:00 Jürgen E. Fischer via Qgis-user <
qgis-user@lists.osgeo.org> ha scritto:

> Hi Amedeo,
>
> On Wed, 16. Nov 2022 at 14:18:57 +0100, Amedeo Fadini via Qgis-user wrote:
> > SELECT count(distinct ("id","field1"))=count(("id","field1")) FROM
> > "public"."mytable"
>
> Check  "use estimated table metadata" in the connection before adding the
> layer.
>
>
> Jürgen
>
>
> --
> Jürgen E. Fischer   norBIT GmbH Tel. +49-4931-918175-31
> Dipl.-Inf. (FH) Rheinstraße 13  Fax. +49-4931-918175-50
> Software Engineer   D-26506 Norden
> https://www.norbit.de
> QGIS release manager (PSC)  Germany IRC: jef on Libera|OFTC
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] QGIS-Server How to avoid unique data check in postgis for each session

2022-11-16 Thread Jürgen E . Fischer via Qgis-user
Hi Amedeo,

On Wed, 16. Nov 2022 at 14:18:57 +0100, Amedeo Fadini via Qgis-user wrote:
> SELECT count(distinct ("id","field1"))=count(("id","field1")) FROM
> "public"."mytable"

Check  "use estimated table metadata" in the connection before adding the
layer.


Jürgen


-- 
Jürgen E. Fischer   norBIT GmbH Tel. +49-4931-918175-31
Dipl.-Inf. (FH) Rheinstraße 13  Fax. +49-4931-918175-50
Software Engineer   D-26506 Nordenhttps://www.norbit.de
QGIS release manager (PSC)  Germany IRC: jef on Libera|OFTC


signature.asc
Description: PGP signature
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] QGIS-Server How to avoid unique data check in postgis for each session

2022-11-16 Thread Amedeo Fadini via Qgis-user
Hi everybody,
My question should be addressed to developers, but I have too many lists,
hope someone reads here too.
For the italian cadastre reference point publication [1]I have a large,
postgis table (~1,7 milions rows across Italy) partitioned over an
attribute list, so the Primary key is on two fields.
The date are published with QGIS server but each time the server receive a
request (GetMap or GetFeatuerinfo) i noticed that QGIS make a qery to check
if the primary key is unique

SELECT count(distinct ("id","field1"))=count(("id","field1")) FROM
"public"."mytable"

that is stated in this line of code:

https://github.com/qgis/QGIS/blob/1373d2bcfcc26a834d4a21a0a95187b77f64d4cd/src/providers/postgres/qgspostgresprovider.cpp#L2008

This query is quite slow, is there a way to set up the postgis table or
QGIS project to avoid this check?
Thanks

Amedeo Fadini

[1] www.topgeometri.it
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user