Re: BUG #17618: unnecessary filter column <> text even after adding index

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: BUG #17618: unnecessary filter column <> text even after adding index
Дата
Msg-id CAMbWs48DuHbqtAgMjpj5Jq_ubxR0+SS-urLuVi=9Dx5FTkJieA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17618: unnecessary filter column <> text even after adding index  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #17618: unnecessary filter column <> text even after adding index
Список pgsql-bugs

On Sun, Nov 6, 2022 at 1:07 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Richard Guo <guofenglinux@gmail.com> writes:
> Update with v3 patch, nothing changes except fixes a test failure
> spotted by cfbot.

I think this is pretty close to usable, except that I don't believe
reusing simplify_boolean_equality this way is a great idea.
It does more than we need (surely the LHS-is-Const case cannot occur here)
and it has assumptions that I'm not sure hold --- particularly the bit
about !constisnull.  I'd be inclined to just copy-and-paste the three or
four lines we need.
 
Thanks for the suggestion.  Yes, simplify_boolean_equality is doing more
than we need.  I think here we just intend to handle indexquals of form
"indexkey = true/false", which seems can only come out from function
match_boolean_index_clause.  From what this function does, we are sure
the constant input can be only on right (as you pointed out), and the
operator can only be BooleanEqualOperator.  Also it seems the assumption
about !constisnull holds, as match_boolean_index_clause would not make a
clause with a constant-NULL input.

I've updated the patch according to the suggestions as in v4.  Thanks
for reviewing this patch!

Thanks
Richard
Вложения

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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17680: execute alter composite type and select composite type concurrently, may cause pg coredump
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17679: REFRESH MATERIALIZED VIEW CONCURRENTLY leaves temporary files?