[QGIS-Developer] Method selectedFeatures() works too slow in QGIS 3 Python console

Nyall Dawson nyall.dawson at gmail.com
Sun Oct 27 15:54:41 PDT 2019


On Thu, 24 Oct 2019 at 18:03, Geo_Nik <v.nikulishyn at gmail.com> wrote:
>
> Hi, I loaded spatial table(about 100 millions rows) from PostgreSQL(PostGIS)
> in QGIS3 and use method *selectedFeatures()* in *QGIS 3* *Python console*.
> For such big tables it work very slow (it takes up to 10 minutes).
> I tried to use * getSelectedFeatures()* which works more faster but returns
> only iterator (not a copy of selected features as previous method). Further
> work with iterator take too much time too(it takes up to 10 minutes).
> In QGIS 2 these methods work much more faster(several seconds).
>
> How can I solve this problem? I want to get copy of selected data for
> several seconds.
> Is this a bug or I am doing some wrong?

I suspect something has changed in how your tables are indexed or in
how QGIS is detecting and using this index. If you've got access to
the database logs it would be useful to compare the queries sent by
QGIS 3 vs 2.

Nyall


>
> POSTGIS="2.5.1 r17027"
> PostgreSQL 11.1 (Ubuntu 11.1-1.pgdg18.04+1)
> QGIS version:3.8.3-Zanzibar
> OS: Windows Server 2019
> Python version: Python 3.7.0
>
> Thanks & Regards
> Volodymyr Nikulishyn
> mobile: +380978472353
>
>
>
>
>
>
>
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list