Why does PostgreSQL ftruncate before unlink? - Mailing list pgsql-general

From Jon Nelson
Subject Why does PostgreSQL ftruncate before unlink?
Date
Msg-id CAKuK5J1YZZXp5KxbGn4AJhAbmfSUCcoFZmp4My+u6s7pgBB3Og@mail.gmail.com
Whole thread Raw
Responses Re: Why does PostgreSQL ftruncate before unlink?  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
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.

--
Jon


pgsql-general by date:

Previous
From: Brian Crowell
Date:
Subject: Re: GSSAPI server side on Linux, SSPI client side on Windows
Next
From: Torsten Förtsch
Date:
Subject: Re: How to continue streaming replication after this error?