Re: Performance with temporary table

From: Decibel! <decibel(at)decibel(dot)org>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: samantha mahindrakar <sam(dot)mahindrakar(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance with temporary table
Date: 2008-04-09 20:09:45
Message-ID: 83F6D568-0641-42CD-8A8D-845119CB3BA1@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Apr 8, 2008, at 2:43 PM, Alvaro Herrera wrote:
> samantha mahindrakar escribió:
>> 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
thousands 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 of using set theory (which generally doesn't work
well).
--
Decibel!, aka Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message John Beaver 2008-04-09 20:58:27 large tables and simple "= constant" queries using indexes
Previous Message Decibel! 2008-04-09 20:00:12 Re: Performance Implications of Using Exceptions