[Qgis-developer] Why is scrolling in the attribute table so slow?

Martin Dobias wonder.sk at gmail.com
Thu Nov 24 08:19:31 EST 2011


2011/11/24 Andreas Neumann <a.neumann at carto.net>:
>
> So is it correct that the QGIS table only loads the "visible" portion of the
> data and if one scrolls, additional layers are requested from the provider?

The attribute table has two strategies how to access the data. For
providers that support fast access to features by ID (that is, it does
not have to go sequentially through the layer)  it only loads the list
of IDs and fetches the features when necessary. For providers without
fast access to features by ID it caches all features' attributes in
memory.

PostGIS supports fast access by feature ID, so the first approach is used.

> Maybe my view definition is slowing things down that much. I have to see if
> I can improve it.

It would be good to use 'EXPLAIN' to see what is going on in the
database - then probably adding some indices on columns of joined
tables will speed things up significantly.

Martin


More information about the Qgis-developer mailing list