On 4 March 2017 at 18:03, Tobias Wendorff
<tobias.wendo...@tu-dortmund.de> wrote:
> Am Sa, 4.03.2017, 08:34 schrieb Alessandro Pasotti:
>>
>> Yes, that would be a strategy, but you might run into problem with
>> sorting and filtering if the data provider does not support for it.
>
> All database-like formats, even Shapefile's DBF, support sorting
> on database level. I've never understood, why some applications
> download the whole content first and

Because it depends on whether the front-ends filtering and sorting
functions match up with the backend's. In the case of QGIS our
expression engine supports a lot of functions which just can't be
translated to Postgres/PostGIS functions. In this case you have no
choice but to fetch everything and do the filtering/sorting on the
client side.

QGIS does have robust support for "compiling expressions", which is
basically translating them from QGIS' expression engine to functions
supported by the backend. This works great for simple expressions, and
depending on the provider even some complex ones (eg postgres provider
has large coverage of mapping qgis functions->provider functions. OGR
does not and can only handle simple field=value compilation). Some
providers also have support for compiling the sort order to perform on
the database side - unfortunately postgres does not (see
https://github.com/qgis/QGIS/blob/master/src/providers/postgres/qgspostgresfeatureiterator.cpp#L130).

I'm sure Matthias would love to re-enable that code and give postgres
a performance boost if someone wants to step up and sponsor it!

Nyall
_______________________________________________
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

Reply via email to