Re: unlogged tables

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: unlogged tables
Дата
Msg-id AANLkTimucBwh4QRdqf80R5V-7UpwCqbEqT43XjtX_Aob@mail.gmail.com
обсуждение исходный текст
Ответ на Re: unlogged tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: unlogged tables  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Sun, Nov 14, 2010 at 1:15 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Cleanup at first connection is something we've been avoiding for years,
> but maybe it's time to bite the bullet and do that?
>

Another alternative is to initialize the unlogged tables when you
first access them. If you try to open a table and there are no files
attached them go ahead and initialize it by creating an empty table
and building any indexes.

Hm, I had been assuming recovery would be responsible for cleaning up
the tables even if the first access is responsible for rebuilding
them. But there's a chance there have been no modifications to them
since the last checkpoint. But in that case the data in them is fine.
It would be a weird interface if it only cleared them out sometimes
based on unpredictable timing though. Avoiding that does require some
kind of alternate storage scheme other than the WAL to indicate what
needs to be cleared out. .init files are as good a mechanism even if
they just mean "unlink this file on startup".

-- 
greg


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: unlogged tables
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Label switcher function