Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables)

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables)
Date: 2016-08-24 05:44:04
Message-ID: CAGTBQpZdTxsTM7sioDWsWS_7fQu96Pz__cg1E93o-L6bhEfNbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 24, 2016 at 2:04 AM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)com> wrote:
> Claudio Freire wrote:
>
>> After looking at it from a birdseye view, I agree it's conceptually
>> complex (reading HeapTupleSatisfiesSelf already makes one dizzy).
>>
>> But other than that, the implementation seems rather simple. It seems
>> to me, if one figures out that it is safe to do so (a-priori, xmin not
>> committed, xmax is current transaction), it would simply be a matter
>> of chasing the HOT chain root, setting all LP except the first to
>> LP_UNUSED and the first one to LP_DEAD.
>>
>> Of course I may be missing a ton of stuff.
>
> What you seem to be missing is that rows corresponding to temp tables
> are not "visible to its own transaction only". The rows are valid
> after the transaction is gone; what makes the tables temporary is the
> fact that they are in a temporary schema. And what makes them invisible
> to one backend is the fact that they are in the temporary schema for
> another backend. Not that they are uncommitted.

Yeah, I was thinking of "on commit drop" behavior, but granted there's
all the others.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Chalke 2016-08-24 05:51:43 Strange result with LATERAL query
Previous Message Amit Kapila 2016-08-24 05:05:17 Re: Write Ahead Logging for Hash Indexes