[postgis-users] difference in query performance due to the inclusion of a polygon geometry field

Sandro Santilli strk at keybit.net
Mon Dec 3 02:04:51 PST 2012


On Mon, Dec 03, 2012 at 10:50:49AM +0100, ivan marchesini wrote:

> Without the geometric field it takes around 86 ms !!
> With the geometric field it takes around 14000 ms !! 
[...]
> In the PostgreSQL mailing Tom Lane suggest that the problem could be due
> to:
> _____________________
>         (1) time to fetch the wide geometry values from the table's
>         TOAST table
[...]
> Can you suggest a way to solve this problem?

Hi Ivan,
I can suggest to extract the identifiers you need with a subquery
(which does NOT include the geometries) and then fetch the geometry
only for the resulting rows (this time using the identifier index).

--strk;


More information about the postgis-users mailing list