Re: several questions about R-tree index

Поиск
Список
Период
Сортировка
От Andrew - Supernews
Тема Re: several questions about R-tree index
Дата
Msg-id slrnd6tnq8.fpt.andrew+nonews@trinity.supernews.net
обсуждение исходный текст
Ответ на several questions about R-tree index  ("TJ O'Donnell" <tjo@acm.org>)
Список pgsql-sql
On 2005-04-26, "TJ O'Donnell" <tjo@acm.org> wrote:
> But I think I might be able to do better (faster) using R-trees.
> Bitstrings can be thought of as "containing" when one bitstring has all the
> same bits set as another, even if it has other bits set too - this is the
> gist of the first where-clause above.
>
> Can I expect to be able to use R-tree's to do this?

You may want to use GIST instead - it is more flexible.

> Will I simply have to define a new datatype and three R-tree functions
> (union, intersection and size).
> Will the use of the ~ (contains) operator cause the planner to consider
> using an index (this is my first question, way above)?

What the planner actually looks for is, having identified the specific
operator and types, whether an index opclass exists for them, and if so
whether an index using that opclass exists. The actual names of the
operators are irrelevent.

So for either rtree or GIST, all you need is to define your new datatype,
with its associated operators, and create an operator class for it with
appropriate support functions, and create indexes using that opclass.
Once all that is done, the planner will consider using them.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


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

Предыдущее
От: "TJ O'Donnell"
Дата:
Сообщение: several questions about R-tree index
Следующее
От: Tom Lane
Дата:
Сообщение: Re: several questions about R-tree index