temp tables versus normal tables

From: "John Lister" <john(dot)lister-ps(at)kickstone(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: temp tables versus normal tables
Date: 2009-02-16 11:00:51
Message-ID: 9174D34EE07949EFBC5A1474995312D9@squarepi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I've got a process that every minute or so selects some data from a number of tables. At the minute i dump this into a normal table, where i do some more processing with it before truncating the table and starting again.. I don't have any indexes on the temporary table but have thought about adding some for the processing stage.

My question is, would a proper temp table be any faster/better. Are they stored entirely in memory or written to disk (i don't care if the data is lost on server restart/crash)

I suppose i could also use a view for the initial "insert into" and bypass the table althogether but i'm guessing this would be slower as the data would need to be looked up each time the view is used for the subsequent processing steps..

Any thoughts

Thanks

JOHN

--

Got needs? Get Goblin'! - http://www.pricegoblin.co.uk/

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Koczan 2009-02-16 22:03:42 New datestyle(s)
Previous Message Craig Ringer 2009-02-16 04:40:30 Re: = or LIKE ?