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

Giuseppe Sucameli sucameli at faunalia.it
Thu Nov 24 07:41:14 EST 2011


Hi all,

On Thu, Nov 24, 2011 at 12:13 PM, Jürgen E. <jef at norbit.de> wrote:
> On Thu, 24. Nov 2011 at 21:04:48 +1000, Nathan Woodrow wrote:
>> If your using PostGIS there seems to be some open/close connection bug.  If
>> you look at the debug log for QGIS while you click, scroll or do anything in
>> a PostGIS backed datasource you will see a lot of database requests.
>
> The attribute table only initially loads the ids of the features and lazy loads
> the actual data when it's needed using featureAtId.

AFAICS the attribute table's model caches only one feature, instead the
view usually displays more than one feature.

When the user scrolls vertically (but also horizontally) the model asks for
all the displayed features w/o using the cached one because it isn't the first
asked for, so it's replaced by another one.

So if the view displays 4 rows then the model asks for 4 feature (and the
provider executes 4 queries), both scrolling vertically by one row and
horizontally by one column.

If your attribute table displays more rows this may become a
problem (unless the data in the fetched rows are few bytes or the
connection is fast).

The solution may be to have a cache growing or shrinking its size
based on the view's row displayed count or bigger enough to avoid
the problem. In both cases we should consider to add a refresh button
to invalidate the cache.

I know that Pete (in cc) was looking deep into and (maybe) working
on that at the HF in Zurich.

@Pete: Any good news?

Regards

> Jürgen
>
> --
> Jürgen E. Fischer         norBIT GmbH               Tel. +49-4931-918175-20
> Dipl.-Inf. (FH)           Rheinstraße 13            Fax. +49-4931-918175-50
> Software Engineer         D-26506 Norden               http://www.norbit.de
>
> --
> norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
> Rheinstrasse 13, 26506 Norden
> GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
Giuseppe Sucameli


More information about the Qgis-developer mailing list