Search Postgresql Archives

Re: How to force planner to use GiST index?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



araza@xxxxxxxx wrote:
Hi,

I have a GiST index on st_geometry type (a user defined type). It looks
like index is not getting hit when I use some geometric operator. Here
is the example of st_contains operator. <snip> How can I force or direct the planner to use the GiST index? Am I missing something?

For the index to be used you need to use an operator that can make use of it. eg something like:

select parcel1.id, count(*) from parcel1, polygons where contains(polygons.the_geom, parcel1.the_geom) and parcel1.geom && polygons.the_geom group by parcel1.id;

the && (inside bounding box) is able to use the gist index, whilst the exact contains is not able to.

Hope that helps,

Joe




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux