Re: Like vs '=' bug with indexing

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Like vs '=' bug with indexing
Дата
Msg-id 6702.981313152@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Like vs '=' bug with indexing  (m w <mttf2000@yahoo.com>)
Список pgsql-hackers
m w <mttf2000@yahoo.com> writes:
> Inconsistent behavior indicates that a different
> matching algorithm is used if one uses an index
> instead of a table scan. That scares me.

A seq scan and an index scan are inherently different algorithms,
so I don't see exactly how you think we can avoid this risk.

In particular, if you are dealing with a btree index and a "WHERE
column = constant" query, then a seq scan is only going to be concerned
with the behavior of the '=' operator --- does it return TRUE or not
for any particular row?  But an index search is inherently going to make
ordered comparisons (<, =, >).  So there is always a potential for
inconsistent behavior if the ordering operators produce results that are
inconsistent with simple '='.  We cannot design that away --- all we can
do is fix such bugs when one is discovered in a particular datatype.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Like vs '=' bug with indexing
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Implementing an operator in C?