Re: sharing temporary tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: sharing temporary tables
Дата
Msg-id 4300.1093362914@sss.pgh.pa.us
обсуждение исходный текст
Ответ на sharing temporary tables  ("Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br>)
Список pgsql-novice
"Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br> writes:
> Do temp tables reside on disk or in RAM?

They are files, just like every other table in Postgres.  To the extent
that you have RAM to spare, the kernel will keep the contents of active
files in memory, so it's quite possible for a table to behave as though
it's in RAM (at least in terms of read speed).

> Can different connections
> access (share) data located in a temporary table created by a
> previous connection/process?

No.  Temp tables are local to a single session.  There are a number of
performance optimizations associated with that, which boil down to the
fact that other sessions couldn't see a consistent state of the data in
a temp table even if they looked (which they won't).

            regards, tom lane

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

Предыдущее
От: Gaetano Mendola
Дата:
Сообщение: Re: MySQL vs PostgreSQL
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: MySQL vs PostgreSQL