Re: Routing of FDW Queries to Secondary databases

From: Adam Blomeke <adam(dot)blomeke(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgpool-general(at)lists(dot)postgresql(dot)org
Subject: Re: Routing of FDW Queries to Secondary databases
Date: 2026-04-23 17:55:19
Message-ID: CAG9AmshakNU03or2vGtrE96knScV6qr7nAepfyHPfX7zQ2L0VQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-general

A lot of our connections operate over foreign data wrappers. We have very
large datasets and we try to segment our analysts off from the actual data
sources. I'd like to be able to balance my read-only FDW queries onto a
secondary database. I've got 2 PGPool instances already, and this would be
beneficial on one of them along with this third one. I realize I'm only one
guy, but having this would be really useful in my implementation.

Cheers,
Adam

On Tue, Apr 21, 2026, 22:36 Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:

> > Hi,
> >
> > I understand that FDW queries don't get routed to the secondary databases
> > since they occur within FETCH blocks.
>
> Yes, currently Pgpool-II does not load balance DECLARE CURSOR/FETCH
> (it's documented). The difficulty is, once DECLARE CURSOR is routed
> to particular server, subsequent FETCH must be routed to the server
> too. Pgpool-II has to track this.
>
> > Is there any planned work to change
> > this.
>
> As far as I know I haven't noticed a request to implement load
> balancing for DECLARE CURSOR/FETCH up to now.
>
> > I have one database I'm about to work on clusterizing, but this
> > limitation makes pgpool impractical as the read side is only accessed via
> > FDWs in all but a very small set of circumstances.
> >
> > Again, I realize the existing limitation; I'm just curious if there's any
> > work on the horizon to add that capability. If not, I will likely need to
> > explore other alternatives for one of the clusters I'm working on.
>
> If there's a strong demand, developers will discuss on implementing
> the feature for the next major release of Pgpool-II (planned to be
> released by the end of this year).
>
> Regards,
> --
> Tatsuo Ishii
> SRA OSS K.K.
> English: http://www.sraoss.co.jp/index_en/
> Japanese:http://www.sraoss.co.jp
>

In response to

Browse pgpool-general by date

  From Date Subject
Next Message Bo Peng 2026-04-27 08:56:10 Re: Problems with SSL communication
Previous Message Zdenek.Koktan 2026-04-23 08:22:41 Problems with SSL communication