Jeff Davis <pgsql@j-davis.com> writes:
> On Wed, 2025-08-20 at 09:22 +0200, Andrei Lepikhov wrote:
>> Building a hash table repeatedly may be pretty costly, no?
> We can check the eflags for EXEC_FLAG_REWIND. That might not be the
> only condition we need to check, but we should know at plan time
> whether a subtree might be executed more than once.
Side note: EXEC_FLAG_REWIND is defined as "you should be prepared
to handle REWIND efficiently". Not as "if this is off, you are
guaranteed not to see a REWIND". I'm not sure that this affects
what Jeff wants to do, but let's not be fuzzy about what information
is available at execution time.
regards, tom lane