public inbox for [email protected]
help / color / mirror / Atom feedFrom: Craig Ringer <[email protected]>
To: Konstantin Knizhnik <[email protected]>
Cc: Pavel Stehule <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Global temporary tables
Date: Fri, 16 Aug 2019 16:32:52 +0800
Message-ID: <CAMsr+YF-_ni33MWLEMc3jtbh_-SFSfBBpXCsPBfiB_bTYKoQug@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<CAMsr+YFahmjG0PaFPL-J7Zxa4cgt_PFtgSNV7nRNgCE=29cvcw@mail.gmail.com>
<[email protected]>
<CAMsr+YER2y7mYb82wNvL6LECvJ_vL3Bv67eToKUuDwL_aLmJaQ@mail.gmail.com>
<[email protected]>
<CAMsr+YEM0kHskTucOwH6d4YPfeTSPXj6bXNH3VcG5jsF3d=-sQ@mail.gmail.com>
<[email protected]>
<CAFj8pRA2iMGNWre-LABC_JRLUi_Ay7mxhbET0Hp7=20CbgF7Lg@mail.gmail.com>
<[email protected]>
<CAFj8pRAJ_fAZrwcp9FgKsS+mGk3g5t2iZnqpcDiPXp=O6DmLFQ@mail.gmail.com>
<CAMsr+YFh5N0TCtaMmUXZ85wJx1EkMwV+cjWWbQvMbtyJsc2ONg@mail.gmail.com>
<[email protected]>
<CAMsr+YHpjEwTWYBbRtOCp5F966yXHeDsBzy1WSUSA1ykVz33mA@mail.gmail.com>
<[email protected]>
<CAMsr+YFFZ2c0XfvNO2FK27gncZn8FdYLjZL2=2wCEy=vDFZk1A@mail.gmail.com>
<[email protected]>
On Fri, 16 Aug 2019 at 15:30, Konstantin Knizhnik <[email protected]>
wrote:
>
> 1. Statistic for global temporary tables (including number of tuples,
> pages and all visible flag).
> My position is the following: while in most cases it should not be a
> problem, because users rarely create indexes or do analyze for temporary
> tables,
> there can be situations when differences in data sets of global temporary
> tables in different backends can really be a problem.
> Unfortunately I can not propose good solution for this problem. It is
> certainly possible to create some private (per-backend) cache for this
> metadata.
> But it seems to requires changes in many places.
>
Yeah. I don't really like just sharing them but it's not that bad either.
> 2. Your concerns about performance penalty of global temp tables accessed
> through shared buffers comparing with local temp tables access through
> local buffers.
> I think that this concern is not actual any more because there is
> implementation of global temp tables using local buffers.
> But my experiments doesn't show significant difference in access speed of
> shared and local buffers. As far as shared buffers are used to be much
> larger than local buffers,
> there are more chances to hold all temp relation in memory without
> spilling it to the disk. In this case access to global temp table will be
> much faster comparing with access to
> local temp tables.
>
You ignore the costs of evicting non-temporary data from shared_buffers,
i.e. contention for space. Also increased chance of backends being forced
to do direct write-out due to lack of s_b space for dirty buffers.
> In case of pulling all content of temp table in memory (pg_prewarm)
global temp table with shared buffers becomes faster.
Who would ever do that?
I forget or do not notice some of your questions, would you be so kind as
> to repeat them?
>
--
Craig Ringer http://www.2ndQuadrant.com/
2ndQuadrant - PostgreSQL Solutions for the Enterprise
view thread (492+ messages) latest in thread
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], [email protected]
Subject: Re: Global temporary tables
In-Reply-To: <CAMsr+YF-_ni33MWLEMc3jtbh_-SFSfBBpXCsPBfiB_bTYKoQug@mail.gmail.com>
* 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