[postgis-users] Centroid out a list of points

strk strk at keybit.net
Fri Jun 12 02:44:24 PDT 2009


On Fri, Jun 12, 2009 at 10:34:21AM +0100, Pedro Doria Meunier wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Thank you Nicklas for your advice! That actually accomplishes it with
> a notable exception:
> 
> Altough the table has a gist index on the geom column the query is
> always executed in Seq Scan mode...
> 
> I ask the gurus which fx is causing this, st_centroid or st_collect ?

It's the WHERE clause driving access strategy.
If you're giving no conditions of course sequential scan is faster.
Only reason to use the gist geometry index is if you use the &&
operator in the WHERE clause, and the analizer finds it to be
enough selective to prefere index vs. sequential scan.

--strk;

 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
 http://foo.keybit.net/~strk/services.html  /\  Keep it simple! 



More information about the postgis-users mailing list