Temp table or normal table for performance?

Поиск
Список
Период
Сортировка
От Stephen Cook
Тема Temp table or normal table for performance?
Дата
Msg-id 4A8BA3C0.1020108@gmail.com
обсуждение исходный текст
Ответы Re: Temp table or normal table for performance?
Список pgsql-general
Let's say I have a function that needs to collect some data from various
tables and process and sort them to be returned to the user.

In general, would it be better to create a temporary table in that
function, do the work and sorting there, and return it... or keep a
permanent table for pretty much the same thing, but add a "user session"
field and return the relevant rows from that and then delete them?

Sorry this is vague, I know it most likely depends on the workload and
such, but I'm just putting this together now. I could go either way, and
also switch it up in the future if necessary. Is there a rule of thumb
on this one?  I'm a bit biased against temporary tables, but then again
if the normal table gets a lot of action it might not be the optimal choice.

Thanks and regards,

Stephen Cook

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: pl/pgsql loop thru columns names
Следующее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Re: question about /etc/init.d/postgresql in PGDG