Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsaRG-0007kz-UA for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Dec 2013 15:50:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VsaRG-0004xH-Cm for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Dec 2013 15:50:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsaRF-0004xA-Ch for pgsql-bugs@postgresql.org; Mon, 16 Dec 2013 15:50:33 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsaR8-0007fm-GH for pgsql-bugs@postgresql.org; Mon, 16 Dec 2013 15:50:32 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 30A155F79E; Mon, 16 Dec 2013 10:50:37 -0500 (EST) Date: Mon, 16 Dec 2013 10:50:37 -0500 From: Stephen Frost To: Anit Chakkarwar Cc: Tom Lane , pgsql-bugs@postgresql.org Subject: Re: BUG #8681: column 'n_tup_del' of pg_stat_user_tables doesn't change in case of truncate Message-ID: <20131216155037.GP2543@tamriel.snowman.net> References: <25088.1386956692@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aXNiKu4lnbRqA5kZ" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.8.0-34-generic (x86_64) X-Uptime: 10:45:32 up 5 days, 18:21, 4 users, load average: 0.11, 0.07, 0.06 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --aXNiKu4lnbRqA5kZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Anit, * Anit Chakkarwar (anitchakkarwar@gmail.com) wrote: > Now n_tup_del = 2, n_tup_ins=120, n_live_tup=20 in pg_stat_user_tables, but > how can I figure out what has happened to 98 rows? This is information for statistics- if you need an accurate count, you'll need to use a trigger and track that information explicitly.. There can be other ways that n_tup_del can end up being inexact. Thanks, Stephen --aXNiKu4lnbRqA5kZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJSryFMAAoJEO1sijiDR2RVW/8QALWj/0GAXf6oGIq3QeBcp/rO Bwv7vdIH70lCim0LwHtIR5tnJgo5BvSsk7K6dBc9xStp4+6lGkv3P9Z2SJExu38O GRIxAlzP72can8FRVa6qp4Q3+D/ahKp/umnUZKQ6GMiCKE4gXXkRuDil446SLHY5 ujT3p496Jw2bHirAEwxrku+8IZALVi3LDIUszISRw0wQaDDMONVp5Ay/mGr7LzFJ oMKdXg71W1w73jbr4scGzCkZPscLd4o/OoYLz+YqGz5VJFjihyc1gJ+9AqnOi6We akOW8Go1v4wG0V1T0QMsjRP3r2xZf6nL52B9j6rulvaKX2zZFeTEcdhXeExf6Jvx co/nYnIk0GBJqjNY6NcqmZS3fzKSAsIVN/9ybu0xOxnO7363nfvKwaw/GJtp50D8 7FY/duXNqgWIfXEfO1eZP4mOcxkbsM4arPJhOloBc6bNMEQ6Gmm6xjmXm/nANcis vELto/0LQwqBT9K29jhoboXIgtVPKNJ6qb8sf41o6yyqx4CSMVaE3aIYL8Kg/D3Q O+45t6zo6R3v5ltLpyvztgFw2zi6QYyaEhkUf9tlGVIwWIa1VZpqHP3VYi/V1HPt XXUEX16YsTCF6+VPmewEkC5gp0MATquetb8QEODXlOmnjTNT/hfIooGje14HFay6 LdmogLk8XISHOGSZY6cn =UTUb -----END PGP SIGNATURE----- --aXNiKu4lnbRqA5kZ--