From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Add support for coordinating record typmods among parallel worke
Date: Fri, 15 Sep 2017 03:03:21 +0000
Message-ID: <E1dsguX-00056N-9x@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Add support for coordinating record typmods among parallel workers.
Tuples can have type RECORDOID and a typmod number that identifies a blessed
TupleDesc in a backend-private cache. To support the sharing of such tuples
through shared memory and temporary files, provide a typmod registry in
shared memory.
To achieve that, introduce per-session DSM segments, created on demand when a
backend first runs a parallel query. The per-session DSM segment has a
table-of-contents just like the per-query DSM segment, and initially the
contents are a shared record typmod registry and a DSA area to provide the
space it needs to grow.
State relating to the current session is accessed via a Session object
reached through global variable CurrentSession that may require significant
redesign further down the road as we figure out what else needs to be shared
or remodelled.
Author: Thomas Munro
Reviewed-By: Andres Freund
Discussion: https://postgr.es/m/CAEepm=0ZtQ-SpsgCyzzYpsXS6e=kZWqk3g5Ygn3MDV7A8dabUA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/cc5f81366c36b3dd8f02bd9be1cf75b2cc8482bd
Modified Files
--------------
src/backend/access/common/Makefile | 2 +-
src/backend/access/common/session.c | 208 +++++++++++
src/backend/access/common/tupdesc.c | 16 +
src/backend/access/transam/parallel.c | 44 ++-
src/backend/storage/lmgr/lwlock.c | 8 +-
src/backend/utils/cache/typcache.c | 634 ++++++++++++++++++++++++++++++++--
src/backend/utils/init/postinit.c | 4 +
src/include/access/session.h | 44 +++
src/include/access/tupdesc.h | 6 +
src/include/storage/lwlock.h | 3 +
src/include/utils/typcache.h | 10 +
src/tools/pgindent/typedefs.list | 4 +
12 files changed, 946 insertions(+), 37 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: pgsql-committers@postgresql.org
Cc: andres@anarazel.de
Subject: Re: pgsql: Add support for coordinating record typmods among parallel worke
In-Reply-To: <E1dsguX-00056N-9x@gemulon.postgresql.org>
* 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