public inbox for [email protected]  
help / color / mirror / Atom feed
From: Sbob <[email protected]>
To: [email protected]
Subject: FDW/Foriegn Table pointing to pgpool never gets load balanced
Date: Tue, 21 Oct 2025 10:31:40 -0600
Message-ID: <[email protected]> (raw)

All;


I setup a Foreign Server pointing to a pgpool instance. Subsequently 
created Foreign Tables work as expected but they are never load 
balanced, it seems they always run on the first available node. My 
latest test used a pgpool config pointing to 2 standby's (no master) and 
set both backend nodes to DISALLOW failovers

I have load balancing configured and I have statement_level_load_balance 
= on

I set log_min_duration_statement to 0 on both backend nodes and ran 
several selects from the local Foreign table, I see this in the logfile 
from data node 0:


2025-10-21 08:52:53.876 MDT [58156] LOG:  duration: 0.032 ms statement: 
START TRANSACTION ISOLATION LEVEL REPEATABLE READ
2025-10-21 08:52:53.877 MDT [58156] LOG:  duration: 0.063 ms parse 
<unnamed>: DECLARE c1 CURSOR FOR
         SELECT id FROM public.abc WHERE ((id < 15))
2025-10-21 08:52:53.877 MDT [58156] LOG:  duration: 0.006 ms  bind 
<unnamed>: DECLARE c1 CURSOR FOR
         SELECT id FROM public.abc WHERE ((id < 15))
2025-10-21 08:52:53.877 MDT [58156] LOG:  duration: 0.043 ms execute 
<unnamed>: DECLARE c1 CURSOR FOR
         SELECT id FROM public.abc WHERE ((id < 15))
2025-10-21 08:52:53.878 MDT [58156] LOG:  duration: 0.043 ms statement: 
FETCH 100 FROM c1
2025-10-21 08:52:53.878 MDT [58156] LOG:  duration: 0.005 ms statement: 
CLOSE c1
2025-10-21 08:52:53.878 MDT [58156] LOG:  duration: 0.016 ms statement: 
COMMIT TRANSACTION




And I see this in the logfile from data node 1:


2025-10-21 08:52:27.675 MDT [58138] LOG:  duration: 0.026 ms statement: 
START TRANSACTION ISOLATION LEVEL REPEATABLE READ
2025-10-21 08:52:27.676 MDT [58138] LOG:  duration: 0.020 ms statement: 
COMMIT TRANSACTION



No matter how many selects I run from the Foreign Table I see the same 
entries in the data node postgres log files and it never load balances 
the queries from the Foreign Table


Anyone have any Ideas how to get this to load balance?


Thanks in advance







reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: FDW/Foriegn Table pointing to pgpool never gets load balanced
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox