"Adriaan van Os" <[EMAIL PROTECTED]> writes: > Recently, I have been doing extensive profiling of a version 8.1.4 Postgres DB > with about 175 tables and 5 GB of data (the server running on Fedora Linux and > the clients on Windows XP). Surprisingly, one of the bottlenecks is TRUNCATE > TABLE and that command is really slow as compared to other operations. For > example, we have operations like:
What filesystem is this? Some filesystems are notoriously slow at deleting large files. The mythtv folk who face this problem regularly recommend either JFS or XFS for this purpose. Postgres generally doesn't really need to be able to delete large files quickly. The only times files are deleted which come to mind are when you DROP or TRUNCATE or possibly when you VACUUM a table. > I noticed, by the way, that removing records in general is painfully slow, but > I didn't do a detailed analysis of that issue yet. That's strange. Deleting should be the *quickest* operation in Postgres. Do you perchance have foreign key references referencing this table? Do you have any triggers? -- Gregory Stark EnterpriseDB http://www.enterprisedb.com ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org