pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <ian.barwick@2ndquadrant.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Keeping state in a foreign data wrapper
Date: Tue, 11 Aug 2020 10:19:10 +0900
Message-ID: <0fa7c591-6ea2-ab84-0665-62c64cb90785@2ndquadrant.com> (raw)
In-Reply-To: <113D4B17-B9EA-425A-896C-0095C73FDF8C@gmail.com>
References: <C6E9F37F-0D02-4BA4-8BB8-C808A31508A1@gmail.com>
	<CAB8KJ=gisTj=QKMJHWZrBjpxaDmt_sjv4F0efw6NiiP_MMqM6A@mail.gmail.com>
	<483E8B68-D9DB-4533-BA82-206F41E53626@gmail.com>
	<CAB8KJ=g4oAdvsTO8eFPAmqj=Uh2kL+W4k1fSfvNYgJyG=TXbxg@mail.gmail.com>
	<113D4B17-B9EA-425A-896C-0095C73FDF8C@gmail.com>

On 2020/08/04 19:21, Stelios Sfakianakis wrote:
 > Thank you again, I have another question in order to make sure I have a clear understanding:
 >
 >
 >> On 4 Aug 2020, at 11:24, Ian Lawrence Barwick <barwick@gmail.com> wrote:
 >>
 >> The hash table is specific to each running backend so will only be
 >> accessed by that process.
 >>
 >> Pre-loading a shared library just gives the library an opportunity to
 >> set up shared memory etc. You can always try adding one of the FDW
 >> libraries to "shared_preload_libraries" and see what happens
 >> (theoretically nothing).
 >>
 >
 > My impression was that since each client (e.g. libpq) connection results in the creation of a Postgres process in the backend (https://www.postgresql.org/developer/backend/) then this  (mysql) "connection pool" hash table is not global per se and shared among the different client / users sessions.

Correct, the connections are specific to each individual backend.

 > But that defeats the purpose, no?

The purpose is to cache connections within the session, to avoid the overhead
of reconnecting to the remote server each time a query for that server is issued
in that session.


Regards

Ian Barwick




-- 
Ian Barwick                   https://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services





view thread (8+ messages)  latest in thread

Message-ID: <0fa7c591-6ea2-ab84-0665-62c64cb90785@2ndquadrant.com>
Permalink:  ../0fa7c591-6ea2-ab84-0665-62c64cb90785@2ndquadrant.com/
Also on:    postgresql.org/message-id/0fa7c591-6ea2-ab84-0665-62c64cb90785@2ndquadrant.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ian.barwick@2ndquadrant.com
  Subject: Re: Keeping state in a foreign data wrapper
  In-Reply-To: <0fa7c591-6ea2-ab84-0665-62c64cb90785@2ndquadrant.com>
  References: <C6E9F37F-0D02-4BA4-8BB8-C808A31508A1@gmail.com> <CAB8KJ=gisTj=QKMJHWZrBjpxaDmt_sjv4F0efw6NiiP_MMqM6A@mail.gmail.com> <483E8B68-D9DB-4533-BA82-206F41E53626@gmail.com> <CAB8KJ=g4oAdvsTO8eFPAmqj=Uh2kL+W4k1fSfvNYgJyG=TXbxg@mail.gmail.com> <113D4B17-B9EA-425A-896C-0095C73FDF8C@gmail.com> <0fa7c591-6ea2-ab84-0665-62c64cb90785@2ndquadrant.com>

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

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