Re: BUG #8681: column 'n_tup_del' of pg_stat_user_tables doesn't change in case of truncate

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: anitchakkarwar(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8681: column 'n_tup_del' of pg_stat_user_tables doesn't change in case of truncate
Date: 2013-12-13 17:44:52
Message-ID: 25088.1386956692@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

anitchakkarwar(at)gmail(dot)com writes:
> If I do truncate then n_tup_del value is 0 but all the rows are deleted from
> table.
> Is this something expected behaviour ?

Yes. We're certainly not going to make TRUNCATE update that count, since
that would require making a pass over the table to count the to-be-deleted
tuples, and the whole point of TRUNCATE is to not make a pass over the
table.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Erik Rijkers 2013-12-13 17:53:58 Re: BUG #8679: Error in regex function
Previous Message Tom Lane 2013-12-13 17:40:30 Re: BUG #8679: Error in regex function