Re: BUG #17618: unnecessary filter column <> text even after adding index - Mailing list pgsql-bugs

From Richard Guo
Subject Re: BUG #17618: unnecessary filter column <> text even after adding index
Date
Msg-id CAMbWs48XWRvRcUSRXVA0ciyP9-RWo=J755khaxiXifivy3zdcQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17618: unnecessary filter column <> text even after adding index  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #17618: unnecessary filter column <> text even after adding index
List pgsql-bugs

On Tue, Nov 8, 2022 at 5:06 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Richard Guo <guofenglinux@gmail.com> writes:
> I've updated the patch according to the suggestions as in v4.  Thanks
> for reviewing this patch!

I was about ready to commit this when I re-read your initial comment
and realized that there's a second way to fix it.  We can improve
predtest.c so that it understands that "x = true" implies "x" and
so on, whereupon the existing logic in create_bitmap_scan_plan
handles the case correctly.  This is pretty nearly the same code as
in your v4, except that it's in a considerably less hot code path, plus
there's at least some chance that it could be useful for other purposes.
So I think I like this way better.  Thoughts?
 
It works for me.  predtest.c is a more common place so that there may be
other cases that can benefit from this change.  Thanks for the new
patch!

Thanks
Richard

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17618: unnecessary filter column <> text even after adding index
Next
From: Tom Lane
Date:
Subject: Re: BUG #17618: unnecessary filter column <> text even after adding index