pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Claudio Freire <klaussfreire@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Jim Nasby <Jim.Nasby@bluetreble.com>
Cc: Aleksander Alekseev <a.alekseev@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables)
Date: Wed, 24 Aug 2016 02:12:36 +0200
Message-ID: <58b5c129-5df4-0bf6-9468-ae119b6428d0@2ndquadrant.com> (raw)
In-Reply-To: <CAGTBQpZssJVSL897FUQmbzBJZSyzavbywQ2o_5BDES20Ei=ayA@mail.gmail.com>
References: <20160801124531.66cde374@fujitsu>
	<13191.1470072250@sss.pgh.pa.us>
	<20160804151451.6fb87507@fujitsu>
	<CA+Tgmob+AS4vPA-wp+KevL7q+qK4c7yZ5wjGvEv6EqPChE2oYQ@mail.gmail.com>
	<CA+q6zcVLO7VoHHpRn9ExkiWksF6TwJ-rabqgwRJgC2_ci8_UEQ@mail.gmail.com>
	<CA+TgmoYstEXxa0KCAPVAVseTwBpb51t=bK1FBU8L8h4sC3XWBQ@mail.gmail.com>
	<14212.1470595566@sss.pgh.pa.us>
	<20160815005755.gswdyjfob7dzw4yp@alap3.anarazel.de>
	<20319.1471223097@sss.pgh.pa.us>
	<20160815010852.5ijua2wm2edzimd4@alap3.anarazel.de>
	<20160815121216.46bd758d@e733>
	<CA+TgmoaTbFPTWEzccd1p6k_v7WwmYGwMOZ3qJYhfQo0-JmyhNQ@mail.gmail.com>
	<95bdc353-1a89-3fe3-1181-eba558c4df83@BlueTreble.com>
	<CA+TgmobRoPj2c9W9g23yeiCZu9ggFGkG8reDhFz8RCON_gMTYg@mail.gmail.com>
	<d6adce51-96f4-c508-d0dc-5311cfb223b6@2ndquadrant.com>
	<CAGTBQpaD_wtUrp+PsL9hDshiVrOCrObeCPFAu+uFkrLKyh-Xtw@mail.gmail.com>
	<40e4f58f-6cd9-01b0-2cc1-67dcb71a5d61@2ndquadrant.com>
	<CAGTBQpZssJVSL897FUQmbzBJZSyzavbywQ2o_5BDES20Ei=ayA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>



On 08/24/2016 12:38 AM, Claudio Freire wrote:
> On Tue, Aug 23, 2016 at 7:25 PM, Tomas Vondra
> <tomas.vondra@2ndquadrant.com> wrote:
>>>> Could someone please explain how the unlogged tables are supposed to fix
>>>> the
>>>> catalog bloat problem, as stated in the initial patch submission? We'd
>>>> still
>>>> need to insert/delete the catalog rows when creating/dropping the
>>>> temporary
>>>> tables, causing the bloat. Or is there something I'm missing?
>>>
>>>
>>> Wouldn't more aggressive vacuuming of catalog tables fix the bloat?
>>>
>>> Perhaps reserving a worker or N to run only on catalog schemas?
>>>
>>> That'd be far simpler.
>>
>>
>> Maybe, although IIRC the issues with catalog bloat were due to a combination
>> of long queries and many temporary tables being created/dropped. In that
>> case simply ramping up autovacuum (or even having a dedicated workers for
>> catalogs) would not realy help due to the xmin horizon being blocked by the
>> long-running queries.
>>
>> Maybe it's entirely crazy idea due to the wine I drank at the dinner, but
>> couldn't we vacuum the temporary table records differently? For example,
>> couldn't we just consider them removable as soon as the backend that owns
>> them disappears?
>
> Or perhaps go all the way and generalize that to rows that never
> become visible outside their parent transaction.
>
> As in, delete of rows created by the deleting transaction could clean
> up, carefully to avoid voiding indexes and all that, but more
> aggressively than regular deletes.
>

Maybe, but I wouldn't be surprised if such generalization would be an 
order of magnitude more complicated - and even the vacuuming changes I 
mentioned are undoubtedly a fair amount of work.

Sadly, I don't see how this might fix the other issues mentioned in this 
thread (e.g. impossibility to create temp tables on standbys),


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (63+ messages)  latest in thread

Message-ID: <58b5c129-5df4-0bf6-9468-ae119b6428d0@2ndquadrant.com>
Permalink:  ../58b5c129-5df4-0bf6-9468-ae119b6428d0@2ndquadrant.com/
Also on:    postgresql.org/message-id/58b5c129-5df4-0bf6-9468-ae119b6428d0@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, klaussfreire@gmail.com, robertmhaas@gmail.com, Jim.Nasby@bluetreble.com, a.alekseev@postgrespro.ru
  Subject: Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables)
  In-Reply-To: <58b5c129-5df4-0bf6-9468-ae119b6428d0@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