Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 131419FB547 for ; Tue, 3 Jul 2007 02:49:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 78166-01 for ; Tue, 3 Jul 2007 02:49:44 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.235]) by postgresql.org (Postfix) with ESMTP id 9A75F9FB4A7 for ; Tue, 3 Jul 2007 02:08:37 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id l8so940834nzf for ; Mon, 02 Jul 2007 22:08:37 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KmGMBNyn3fLLKvOvd7S3whWwtrtc7L4yeLl2g91WrmC4nltgpyGiqyU3hH1ch3R0I8K03KozOT6bqZY0zh9r0qsVhitOkWHk+qal1YaXtCNUkv54QgDGW9Q76xHvbvGr9cGOVaQQAaspsNVjnx776PPx1UKve61jhPBhCFNbQzY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NH+UTQ4GQxBCc62qx3xrGcOsk9/d1ivOgQP15WWvk+1vxykJfZIehChqRfCqhJ69h0RpM+GbG76tkYaafi+rQx+2gOBZ1rkpHW0AmzZkSSB0RBMGGJ4OszA4FMSyOy0nQP/3iy932VGQi5mV/qQXJooZDnT4S7oS7wtlt4y9884= Received: by 10.142.83.4 with SMTP id g4mr406071wfb.1183439316414; Mon, 02 Jul 2007 22:08:36 -0700 (PDT) Received: by 10.142.88.4 with HTTP; Mon, 2 Jul 2007 22:08:36 -0700 (PDT) Message-ID: <162867790707022208w267d43aard8ee2dabc219bb38@mail.gmail.com> Date: Tue, 3 Jul 2007 07:08:36 +0200 From: "Pavel Stehule" To: "Gregory Stark" Subject: Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL Cc: "Jaime Casanova" , "Alvaro Herrera" , "Tom Lane" , "Jim Nasby" , PostgreSQL-development In-Reply-To: <87d4za5jsg.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <162867790707011431u71e53543x19e64e5bb160b124@mail.gmail.com> <17505.1183326406@sss.pgh.pa.us> <19689F96-2FE1-4343-BE86-94317AEB0C57@decibel.org> <19728.1183394601@sss.pgh.pa.us> <20070703004634.GB4757@alvh.no-ip.org> <87d4za5jsg.fsf@oxford.xeocode.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/55 X-Sequence-Number: 104970 2007/7/3, Gregory Stark : > > "Jaime Casanova" writes: > > > while not just a new rekind indicating this is a template and not and > > actual table. and using that template for creating the actual tables? > > For precisely the reason stated upthread. That would mean creating and > deleting catalog entries for every transaction. Imagine a busy OLTP system > running hundreds of transactions per second trying to use a temporary table > for intermediate results. Mixing DDL and DML is just as bad an idea behind the > scenes as it is for users. > Global temp table can be created from template only when is used. It's has not negative efect on app which doesn't use it. The benefit of g.t.t. is simplifycation of stored procedures. regards Pavel Stehule