Optimizing queries that use temporary tables

Поиск
Список
Период
Сортировка
Искать

Optimizing queries that use temporary tables

От:
"Luiz K. Matsumura" <luiz@planit.com.br>
Дата:
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 ?

If yes...
- This indexes will be destroyed together (automatic?) the temp table 
when the connection is closed ?
- When I insert a lot of new rows, need to run analyze on this temporary 
table ?

Thanks in Advance.

-- 
Luiz K. Matsumura
Plan IT Tecnologia Informática Ltda.

Re: Optimizing queries that use temporary tables

От:
"Scott Marlowe" <scott.marlowe@gmail.com>
Дата:
On Jan 22, 2008 1:32 PM, Luiz K. Matsumura  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
FAQ