Skip site navigation (1) Skip section navigation (2)

Re: TRUNCATE TABLE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adriaan van Os <postgres(at)microbizz(dot)nl>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: TRUNCATE TABLE
Date: 2007-07-11 21:54:45
Message-ID: 3561.1184190885@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Adriaan van Os <postgres(at)microbizz(dot)nl> writes:
> Surprisingly, one of the bottlenecks is TRUNCATE TABLE and that
> command is really slow as compared to other operations.

When you don't quantify that statement at all, it's hard to make an
intelligent comment on it, but TRUNCATE per se shouldn't be slow.
Are you sure you are not measuring a delay to obtain exclusive lock
on the table before it can be truncated (ie, waiting for other
transactions to finish with it)?

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Gregory StarkDate: 2007-07-11 22:15:52
Subject: Re: TRUNCATE TABLE
Previous:From: Patric de WahaDate: 2007-07-11 20:48:51
Subject: Re: Two questions.. shared_buffers and long reader issue

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group