pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: samantha mahindrakar <sam.mahindrakar@gmail.com>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance with temporary table
Date: Tue, 8 Apr 2008 15:28:03 -0400
Message-ID: <f0c828c40804081228x6e1edf2l881fe0725f1a5504@mail.gmail.com> (raw)
In-Reply-To: <20080408161745.GB9062@alvh.no-ip.org>
References: <f0c828c40804071127u512a5f89ka7866a148e3c7c21@mail.gmail.com>
	<20080408161745.GB9062@alvh.no-ip.org>

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?

Thanks
Samantha

On 4/8/08, Alvaro Herrera <alvherre@commandprompt.com> wrote:
> samantha mahindrakar escribió:
>
> > So the program necessarily creates a temporary table evrytime it has
> > to correct a record. However this table is dropeed after each record
> > is corrected.
>
> Perhaps it would be better to truncate the temp table instead.
>
> > Iam not sure if i can use a cursor to replicate the functionality of
> > the temp table. Is the performance bad because of the creation and
> > deletion of the temp table?
>
> Yes -- if you create/drop thousands of temp tables (or create/drop the
> same temp table thousands of time), the resulting catalog bloat is
> likely to hinder performance.  Perhaps autovacuum should be at work here
> (and if not you can solve the issue with manual vacuums to the system
> catalogs), but even then it is at best unnecessary.
>
> --
> Alvaro Herrera                                http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>



view thread (12+ messages)  latest in thread

Message-ID: <f0c828c40804081228x6e1edf2l881fe0725f1a5504@mail.gmail.com>
Permalink:  ../f0c828c40804081228x6e1edf2l881fe0725f1a5504@mail.gmail.com/
Also on:    postgresql.org/message-id/f0c828c40804081228x6e1edf2l881fe0725f1a5504@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: sam.mahindrakar@gmail.com, alvherre@commandprompt.com
  Subject: Re: Performance with temporary table
  In-Reply-To: <f0c828c40804081228x6e1edf2l881fe0725f1a5504@mail.gmail.com>
  References: <f0c828c40804071127u512a5f89ka7866a148e3c7c21@mail.gmail.com> <20080408161745.GB9062@alvh.no-ip.org> <f0c828c40804081228x6e1edf2l881fe0725f1a5504@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox