Re: Temporary tables and disk activity

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Temporary tables and disk activity
Дата
Msg-id 27117.1102964651@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Temporary tables and disk activity  (Phil Endecott <spam_from_postgresql_general@chezphil.org>)
Ответы Re: Temporary tables and disk activity
Список pgsql-general
Phil Endecott <spam_from_postgresql_general@chezphil.org> writes:
> Does this make sense?  I imagine that the temporary table is being added
> to these tables and then removed again.

Yes, a temp table has the same catalog infrastructure as a regular
table, so creation and deletion of a temp table will cause some activity
in those catalogs.  I thought you were concerned about the data within
the temp table, though.

> I do have quite a large number of tables in the database; I have one
> schema per user and of the order of 20 tables per user and 200 users.  I
> can imagine that in a system with fewer tables this would be
> insignificant, yet in my case it seems to be writing of the order of a
> megabyte in each 5-second update.

That seems like a lot.  How often do you create/delete temp tables?

> I should mention that I ANALYSE the temporary table after creating it
> and before using it for anything;  I'm not sure if this does any good
> but I put it in as it "couldn't do any harm".

This is a good idea (if you analyze after filling the table) ... but it
will cause catalog traffic too, because again the pg_statistic rows go
into the regular pg_statistic catalog.

            regards, tom lane

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

Предыдущее
От: Phil Endecott
Дата:
Сообщение: Re: Temporary tables and disk activity
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Substring question