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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>
Subject: Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables)
Date: 2016-08-18 15:03:34
Message-ID: CAFj8pRBgZ+Jec+V1zVbN+JY7mMxeJsoUZyW6DmfcVFUpxDzROg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2016-08-18 16:33 GMT+02:00 Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>:

> On 08/15/2016 12:23 PM, Pavel Stehule wrote:
>
>>
>>
>> 2016-08-15 12:18 GMT+02:00 Aleksander Alekseev
>> <a(dot)alekseev(at)postgrespro(dot)ru <mailto:a(dot)alekseev(at)postgrespro(dot)ru>>:
>>
>> > The global temporary tables has persistent rows in the catalogue.
>> The
>> > mapping to files can be marked as special and real mapping should be
>> > only in memory.
>> >
>> > So the changes in catalogue related to global temporary tables are
>> > pretty less frequently.
>>
>> I'm afraid I still don't get it. Let say I have an application that
>> does `CREATE TEMP TABLE xx ; DROP TABLE xx` in every session all the
>> time. Naturally there is not only one temp table per session. Could
>> you
>> explain please in more detail how exactly do these persistent rows
>> help?
>>
>>
>> when you use global temporary tables, then you create it only once -
>> like usual tables.
>>
>> you don't drop these tables.
>>
>>
> I share the view that this is a better/simpler solution to the problem. It
> will still require virtual (in-memory) tuples for pg_statistic records, but
> everything else works pretty much as for regular tables. In particular
> there are no problems with dependencies.
>
> The obvious disadvantage is that it requires changes to applications.

sure - as plpgsql developer I can say, the global temp tables are much more
friendly - so rewriting in application is enjoy work.

Regards

Pavel

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2016-08-18 15:05:20 Re: [Patch] New psql prompt substitution %r (m = master, r = replica)
Previous Message Tom Lane 2016-08-18 14:53:26 Re: regexp_match() returning text