Re: pg temp tables

From: "Anton Melser" <melser(dot)anton(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Robert Treat" <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg temp tables
Date: 2007-03-07 21:26:18
Message-ID: 92d3a4950703071326g127a44a9v45aed6246033e71e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/03/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Anton Melser" <melser(dot)anton(at)gmail(dot)com> writes:
> > Thanks for your reply. I am managing a db that has some export scripts
> > that don't do a drop/create, but rather a delete from at the start of
> > the proc (6 or 7 tables used for this, and only this). Now given that
> > there is no vacuuming at all going on - this is clearly suboptimal but
> > in the general case is this better/worse than using temporary tables?
>
> Delete all rows, you mean? Have you considered TRUNCATE?

Hi,
... I have considered lots of things - but I didn't write the scripts!
Now that you mention it, I do remember that truncate is much better
than
delete from mytable;
That is not what they wrote but hey. But even then, what are the
advantages/disadvantages of temp tables? Is there a document somewhere
I can consult which will give me the lowdown on permanent (but
temporary) versus temporary tables in pg?
Cheers
Anton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Webb Sprague 2007-03-07 21:44:51 Re: Database slowness -- my design, hardware, or both?
Previous Message Tom Lane 2007-03-07 20:17:25 Re: invalid page header in pg_statistic