Re: POC, WIP: OR-clause support for indexes - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: POC, WIP: OR-clause support for indexes
Date
Msg-id CAPpHfdsp5mWaCS8BtcgPPnnD4LUfQQ1e_wOc3XPwi9ku6cGUrQ@mail.gmail.com
Whole thread Raw
In response to Re: POC, WIP: OR-clause support for indexes  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-hackers
On Mon, Jul 22, 2024 at 3:52 AM Alexander Korotkov <aekorotkov@gmail.com> wrote:
> Please, check that there is still possibility to the generate BitmapOr plan.
>
> # explain select * from t where (b = 1 or b = 2 or a = 2 or a = 3);
>                                      QUERY PLAN
> ------------------------------------------------------------------------------------
>  Bitmap Heap Scan on t  (cost=326.16..835.16 rows=14999 width=12)
>    Recheck Cond: ((b = 1) OR (b = 2) OR (a = 2) OR (a = 3))
>    ->  BitmapOr  (cost=326.16..326.16 rows=20000 width=0)
>          ->  Bitmap Index Scan on t_b_c_idx  (cost=0.00..151.29
> rows=10000 width=0)
>                Index Cond: (b = 1)
>          ->  Bitmap Index Scan on t_b_c_idx  (cost=0.00..151.29
> rows=10000 width=0)
>                Index Cond: (b = 2)
>          ->  Bitmap Index Scan on t_a_b_idx  (cost=0.00..4.29 rows=1 width=0)
>                Index Cond: (a = 2)
>          ->  Bitmap Index Scan on t_a_b_idx  (cost=0.00..4.29 rows=1 width=0)
>                Index Cond: (a = 3)

Forgot to mention that I have to
# set enable_seqscan = off;
to get this plan.

------
Regards,
Alexander Korotkov
Supabase



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Patch bug: Fix jsonpath .* on Arrays
Next
From: Michael Paquier
Date:
Subject: Re: pg_upgrade and logical replication