About index for temporay table in a plpgsql function

Поиск
Список
Период
Сортировка
От Emi Lu
Тема About index for temporay table in a plpgsql function
Дата
Msg-id 4419E362.4030303@encs.concordia.ca
обсуждение исходный текст
Ответы Re: About index for temporay table in a plpgsql function  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
Список pgsql-general
Hello,

A question about index for temporary table.

Postgresql 8.0.1, in a pl/pgsql function:
begin
...
-- Part I
create temporal table t1 as ((select ... from .. left join ..... where
... ) union (select .. from ... left join ... where ...  ));
create index idx_t1_cols on t1(col1, col2) tablespace ts1;

...
-- Part II
insert into tableX
(
  select ...
  from tableY
  left join t1 using (col1, col2)
  where ... ...
)
...
end;

In the above example, the index for t1 can speed up the left join query
in part II (although, there is no analyze done after the creation of
index), right?

The temporary table will be dropped automatically at the end of the
function, right?
By the way, is there anythings need to pay especially attention about
temporary table under a function please?

Thanks a lot,
Ying



В списке pgsql-general по дате отправления:

Предыдущее
От: "Stephen Slezak"
Дата:
Сообщение: Re: PostgreSQL Knowledge Base
Следующее
От: "Brandon Keepers"
Дата:
Сообщение: Re: Relation 'pg_largeobject' does not exist