Re: How to force planner to use GiST index?

Поиск
Список
Период
Сортировка
От Joe Healy
Тема Re: How to force planner to use GiST index?
Дата
Msg-id 45EF5BE6.7010708@omc-international.com.au
обсуждение исходный текст
Ответ на How to force planner to use GiST index?  (araza@esri.com)
Ответы Re: How to force planner to use GiST index?  (araza@esri.com)
Список pgsql-general
araza@esri.com 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



В списке pgsql-general по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: [HACKERS] WITH/RECURSIVE plans
Следующее
От: Brent Wood
Дата:
Сообщение: Re: How to force planner to use GiST index?