pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: samantha mahindrakar <sam.mahindrakar@gmail.com>
To: Decibel! <decibel@decibel.org>
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance with temporary table
Date: Wed, 9 Apr 2008 19:41:18 -0400
Message-ID: <f0c828c40804091641w36b98fb9o7a4019f576d53ec6@mail.gmail.com> (raw)
In-Reply-To: <83F6D568-0641-42CD-8A8D-845119CB3BA1@decibel.org>
References: <f0c828c40804071127u512a5f89ka7866a148e3c7c21@mail.gmail.com>
	<20080408161745.GB9062@alvh.no-ip.org>
	<f0c828c40804081228x6e1edf2l881fe0725f1a5504@mail.gmail.com>
	<20080408194310.GP9062@alvh.no-ip.org>
	<83F6D568-0641-42CD-8A8D-845119CB3BA1@decibel.org>

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! <decibel@decibel.org> wrote:
> 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@decibel.org
>  Give your computer some brain candy! www.distributed.net Team #1828
>
>
>



view thread (12+ messages)  latest in thread

Message-ID: <f0c828c40804091641w36b98fb9o7a4019f576d53ec6@mail.gmail.com>
Permalink:  ../f0c828c40804091641w36b98fb9o7a4019f576d53ec6@mail.gmail.com/
Also on:    postgresql.org/message-id/f0c828c40804091641w36b98fb9o7a4019f576d53ec6@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: sam.mahindrakar@gmail.com, decibel@decibel.org, alvherre@commandprompt.com
  Subject: Re: Performance with temporary table
  In-Reply-To: <f0c828c40804091641w36b98fb9o7a4019f576d53ec6@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