Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group