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

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Janes <jeff.janes@gmail.com>, sindysenorita@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2022-11-02T07:46:30Z
Lists: pgsql-bugs

Attachments

On Mon, Sep 26, 2022 at 7:42 PM Richard Guo <guofenglinux@gmail.com> wrote:

> On Sat, Sep 24, 2022 at 8:41 AM Richard Guo <guofenglinux@gmail.com>
> wrote:
>
>> Yeah, I agree that running eval_const_expressions here is expensive.
>> Maybe we can just do the reverse transformation in
>> create_bitmap_scan_plan against what we do for boolean index in
>> match_boolean_index_clause?
>>
>
> Following this idea, I come up with v2 patch. Is this the right
> direction to go?
>

Update with v3 patch, nothing changes except fixes a test failure
spotted by cfbot.

Thanks
Richard

Commits

  1. Produce more-optimal plans for bitmap scans on boolean columns.