Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 33F4163292B for ; Sat, 24 Apr 2010 16:51:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 35048-09 for ; Sat, 24 Apr 2010 19:50:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 8BE18632A64 for ; Sat, 24 Apr 2010 16:51:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o3OJp1UR011888; Sat, 24 Apr 2010 15:51:01 -0400 (EDT) To: Robert Haas cc: Greg Sabino Mullane , pgsql-hackers@postgresql.org Subject: Re: global temporary tables In-reply-to: References: <7796.1272125493@sss.pgh.pa.us> <9452.1272130726@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Sat, 24 Apr 2010 14:51:34 -0400" Date: Sat, 24 Apr 2010 15:51:01 -0400 Message-ID: <11887.1272138661@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.106 tagged_above=-10 required=5 tests=AWL=-0.196, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/1125 X-Sequence-Number: 161237 Robert Haas writes: > ... Why would the > end-of-session processing need the catalog entries? It seems like > whatever backend-local data structure we're using to record the > relfilenode mappings would be sufficent to nuke the backend storage, > and what else needs doing? Well, if you're intending to have a separate data structure and code path for cleaning up this type of temp table, then maybe you don't need to touch any catalog entries. I'm concerned though about how far the effects will propagate --- things like TRUNCATE, VACUUM FULL, REINDEX will probably have issues with this. Right now they think in terms of writing a new pg_class entry in order to reassociate tables with new relfilenodes. Have you thought much about the previously proposed design, ie keeping catalog entries for temp tables in backend-local temporary catalogs? That would certainly be a lot of work, but I think in the end it might fit in better. This design feels like it's being driven by "hey, we can abuse the relmapper to sort of do what we want", and not by what we really want. regards, tom lane