Re: Optimizing queries that use temporary tables

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Luiz K(dot) Matsumura" <luiz(at)planit(dot)com(dot)br>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Optimizing queries that use temporary tables
Date: 2008-01-22 20:34:15
Message-ID: dcc563d10801221234j3ca441ebs2aee2da9165d1ca3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Jan 22, 2008 1:32 PM, Luiz K. Matsumura <luiz(at)planit(dot)com(dot)br> wrote:
> Hello,
>
> I'm developing some routines that will use temporary tables and need
> advice on how to not lose performance.
>
> I will insert data in a temporary table and use this data to generate
> new sets that will update or add to the same temporary table.
>
> I have some questions that I'm concerned about:
>
> - I can create indexes on this temp table to optimize queries ?

Yes

> If yes...
> - This indexes will be destroyed together (automatic?) the temp table
> when the connection is closed ?

Yes

> - When I insert a lot of new rows, need to run analyze on this temporary
> table ?

Yes

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Guillaume Smet 2008-01-23 00:57:07 Workaround for cross column stats dependency
Previous Message Joshua D. Drake 2008-01-22 20:19:21 Re: SELECT * FROM table is too slow