Re: Failing assertions in indxpath.c, placeholder.c and brin_minmax.c

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Failing assertions in indxpath.c, placeholder.c and brin_minmax.c
Дата
Msg-id 20150728183942.GA2441@postgresql.org
обсуждение исходный текст
Ответ на Re: Failing assertions in indxpath.c, placeholder.c and brin_minmax.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Failing assertions in indxpath.c, placeholder.c and brin_minmax.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:

> Bottom line is that somebody failed to consider the possibility of a
> null comparison value reaching the BRIN index lookup machinery.
> The code stanza that's failing supposes that only IS NULL or IS NOT NULL
> tests could have SK_ISNULL set, but that's just wrong.

I think the easiest way to solve this is to consider that all indexable
operators are strict, and have the function return false in that case.
The attached patch implements that.  (In a quick check, the only
non-strict operator in the regression database is <%(point,widget),
which seems okay to ignore given that the type itself is only part of
pg_regress.  I wonder what would happen if the regression tests defined
an index using that operator.)

What btree actually does is precompute a "qual_ok" property at
scan-restart time, which seems pretty clever (maybe too much).  I think
something like _bt_preprocess_keys should probably be applied to BRIN
scans someday.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: TODO: replica information functions
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: more RLS oversights