Re: Why does PostgreSQL ftruncate before unlink?

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Why does PostgreSQL ftruncate before unlink?
Дата
Msg-id CAOR=d=16yT+mHuCaY0aBtHQURK5mAbxUYQMGJxUg+uYRdC1ktw@mail.gmail.com
обсуждение исходный текст
Ответ на Why does PostgreSQL ftruncate before unlink?  (Jon Nelson <jnelson+pgsql@jamponi.net>)
Ответы Re: Why does PostgreSQL ftruncate before unlink?  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general
On Fri, Feb 21, 2014 at 4:14 PM, Jon Nelson <jnelson+pgsql@jamponi.net> wrote:
> When dropping lots of tables, I noticed postgresql taking longer than
> I would have expected.
>
> strace seems to report that the largest contributor is the ftruncate
> and not the unlink. I'm curious what the logic is behind using
> ftruncate before unlink.
>
> I'm using an ext4 filesystem.

I'm guessing that this is so that it can be rolled back. Unlink is
likely issued at commit;


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

Предыдущее
От: Haribabu Kommi
Дата:
Сообщение: Re: How to continue streaming replication after this error?
Следующее
От: Torsten Förtsch
Дата:
Сообщение: Re: How to continue streaming replication after this error?