Re: [HACKERS] has anybody else used r-tree indexes in 6.5?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] has anybody else used r-tree indexes in 6.5?
Дата
Msg-id 9114.929748943@sss.pgh.pa.us
обсуждение исходный текст
Ответ на has anybody else used r-tree indexes in 6.5?  (Jeff Hoffmann <jeff@remapcorp.com>)
Ответы RE: [HACKERS] has anybody else used r-tree indexes in 6.5?  ("Stupor Genius" <stuporg@erols.com>)
Re: [HACKERS] has anybody else used r-tree indexes in 6.5?  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
Jeff Hoffmann <jeff@remapcorp.com> writes:
> has something changed with r-tree indexes in 6.5?
> ERROR:  Operator 500 must have a restriction selectivity estimator to be
> used in a btree index

What we have here is a big OOOPS.

The reference to "btree" is coming from btreesel, which it turns out is
called by rtreesel as well --- I missed that the first time around.
But that's just a cosmetic problem in the error message.  The real
problem is that none of the operators that are used for rtree indexes
have restriction selectivity estimators.

They *used* to have selectivity estimators in 6.4.2 --- they all pointed
at intltsel, which is pretty much completely inappropriate for an area-
based comparison.  I believe I must have removed those links from the
pg_operator table during one of my cleanup-and-make-consistent passes.

The right fix would be to put in an appropriate selectivity estimator,
but we can't do that as a 6.5.* patch because changing pg_operator
requires an initdb.  It will have to wait for 6.6.  (One of my to-do
items for 6.6 was to rewrite the selectivity estimators anyway, so I'll
see what I can do.)  In the meantime, I think the only possible patch is
to disable the error check in btreesel and have it return a default
selectivity estimate instead of complaining.  Drat.

Apparently, none of the regression tests exercise rtree indexes at all,
else we'd have known there was a problem.  Adding an rtree regression test
seems to be strongly indicated as well...
        regards, tom lane


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

Предыдущее
От: adrian@ezymail.com
Дата:
Сообщение: Where in the world is pgsql-hackers@postgresql.org??
Следующее
От: "Stupor Genius"
Дата:
Сообщение: RE: [HACKERS] has anybody else used r-tree indexes in 6.5?