Re: Planning time quadratic in the IN-list length for "c = X AND (a, b) IN (...)" with BitmapOr

From: Manu <manuelreyesbravo(at)gmail(dot)com>
To: Stefan Guha <stefan(at)stefanguha(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Planning time quadratic in the IN-list length for "c = X AND (a, b) IN (...)" with BitmapOr
Date: 2026-10-05 19:21:53
Message-ID: 179122811396.405152.635326698767697207@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Stefan,

Thank you for the thorough read -- your five points match the intent,
and I appreciate you checking the pitem != tried aliasing and the
plain-OR-only guard, since those are the two places it could have gone
wrong.

> guarding the inner loop with "if (!presult)" avoids starting the
> iterator after a successful first attempt and states the intent more
> directly.

Agreed, and it reads better. I measured it too and the saving does not
show in planning time, so I'd rather not reset the review with a new
version right before you mark it Ready for Committer. I have it ready
as a one-line change if you or the committer would prefer it in the
tree now; otherwise it is just as fine to fold in at commit time.

Thanks again for the review.

Regards,
Manu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-10-05 19:36:36 Re: UNDO with constant time recovery (CTR)
Previous Message Joao Detomini 2026-10-05 19:21:10 Re: Limiting WAL retained for archiving, like max_slot_wal_keep_size