Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 5FB792E0054 for ; Wed, 9 Apr 2008 20:41:23 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 54668-01 for ; Wed, 9 Apr 2008 20:41:12 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by developer.postgresql.org (Postfix) with ESMTP id 7FBC82E0049 for ; Wed, 9 Apr 2008 20:41:19 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id m38so2694108waf.5 for ; Wed, 09 Apr 2008 16:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; 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; bh=ipTEkQzBDswvlN1T3XUJ3w4M4rDjra2g7Xet0hulDRY=; b=n3NSI9IBa6/JEBTfpYAWDJNdX+wpQ50RlX7sQjZUezPAuobPqA8Ay9kim7GOrwhvDdFBCLtRwvXKbOVqW4pWEy7jJ5pq66lOw5/Zt2xalut8qIgsEBRz4FN4s9rd6rrtys99t9mdAcxBtcrf0xZgrXyRcMqcHWwAed3oqwg1ngg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UcyHDdEDBwddup+8OyIL5hqGuiF7rbwdTXXdKmtsHjdFYFpprXLPvfZdo0s55Ewl2l6/7Ml/CQUi+iI8Pd+CtvqqvxzLZm1IjpFFmD64Tz6OxYBk88i7BeQ02RTDtRaMfzlcgpss0wmKjVGVZ14RC80zhbHsA/pJQunoUbTsOgg= Received: by 10.114.58.6 with SMTP id g6mr1016943waa.138.1207784478200; Wed, 09 Apr 2008 16:41:18 -0700 (PDT) Received: by 10.114.181.19 with HTTP; Wed, 9 Apr 2008 16:41:18 -0700 (PDT) Message-ID: Date: Wed, 9 Apr 2008 19:41:18 -0400 From: "samantha mahindrakar" To: Decibel! Subject: Re: Performance with temporary table Cc: "Alvaro Herrera" , pgsql-performance@postgresql.org In-Reply-To: <83F6D568-0641-42CD-8A8D-845119CB3BA1@decibel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20080408161745.GB9062@alvh.no-ip.org> <20080408194310.GP9062@alvh.no-ip.org> <83F6D568-0641-42CD-8A8D-845119CB3BA1@decibel.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/119 X-Sequence-Number: 29612 Hi The reason for using the temporary table is that i need this data buffered somewhere so that i can use it for later computation. And the fact that for each imputation i need to have historical data from 10 previous weeks makes it necessary to create something that can hold the data. However once the computation is done for each record i wouldn't need that historical data for that record. I Would be moving on to the next record and find its own historical data. Is there any way i can avoid using temp table? Samantha On Wed, Apr 9, 2008 at 4:09 PM, Decibel! wrote: > On Apr 8, 2008, at 2:43 PM, Alvaro Herrera wrote: > > > samantha mahindrakar escribi=F3: > > > > > Well instead of creating a temp table everytime i just created a > > > permanant table and insert the data into it everytime and truncate it= . > > > I created indexes on this permanent table too. This did improve the > > > performance to some extent. > > > > > > Does using permanant tables also bloat the catalog or hinder the > performance? > > > > > > > In terms of catalog usage, permanent tables behave exactly the same as > > temp tables. > > > > True, but the point is that you're not bloating the catalogs with thousa= nds > of temp table entries. > > I agree with others though: it certainly doesn't sound like there's any > reason to be using temp tables here at all. This sounds like a case of > trying to apply procedural programming techniques to a database instead o= f > using set theory (which generally doesn't work well). > -- > Decibel!, aka Jim C. Nasby, Database Architect decibel@decibel.org > Give your computer some brain candy! www.distributed.net Team #1828 > > >