Worker parallelism on EXECUTE with a non-zero fetch count

From: Rohit Sivakumar <rsivakumar(at)rippling(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: davechir(at)amazon(dot)com
Subject: Worker parallelism on EXECUTE with a non-zero fetch count
Date: 2024-10-10 15:22:48
Message-ID: CABp=a9shsChnqL6n94p1Uqku3o5Exkw9Q8X4pqTwnZVED4v3Bw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

Quoting an excerpt from Chapter 15.2 of postgres' official documentation
(versions 12 through latest),

*"Even when a parallel query plan is generated for a particular query,
there are several circumstances under which it will be impossible to
execute that plan in parallel at execution time."*

The documentation goes on to describe cases where the plan cannot be
executed in parallel, which includes,

*The client sends an Execute message with a non-zero fetch count. See the
discussion of the extended query protocol ...*

I fail to understand why firing the Execute message with a non-zero fetch
count is not being parallelized. Is there a technical limitation here, or
is it simply that this is a feature that has not been built yet? I noticed
that my query was using the Extended protocol, and suffers from this
limitation.

As for solutions, I'm aware that using the Simple query protocol gives me
the performance I need; but that's not the point of this question. I'd like
to fundamentally understand what makes the same parallel-execution
behaviour impossible with the Extended query protocol.

Thanks,
Rohit

Browse pgsql-hackers by date

  From Date Subject
Next Message James Hunter 2024-10-10 15:25:12 Re: [PATCH] Move clause_sides_match_join() into pathnode.h
Previous Message Fujii Masao 2024-10-10 15:14:50 Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.