Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 521A5B5DC3B for ; Wed, 25 May 2011 14:32:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 12971-03 for ; Wed, 25 May 2011 17:32:23 +0000 (UTC) X-Greylist: delayed 00:08:01.66515 by SQLgrey-1.7.6 Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181]) by mail.postgresql.org (Postfix) with ESMTP id 434B8B5DC35 for ; Wed, 25 May 2011 14:32:23 -0300 (ADT) Received: by qyg14 with SMTP id 14so4624427qyg.19 for ; Wed, 25 May 2011 10:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=tWRYtPEzrUTdjPINoDTORqElqwaHZuyC5LOIO+KEXNw=; b=YvvyaR2PFAN89KBPdK1qXIITuX/Djp8JUfElNgsBMnXXoVoNxOUDKvkUVaSTwiZ/Yw 7Xam8ZKbWy1qqu1Sqd4vuSlQ4bXKhDwKC1U0p40VGhtxZiB7k4XR7m4N04cgZicxfQwP vr8B+jIuyVSgaggS39lTHGG8ycs1wC1YxhSMM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=Kr4wZjzbfrpBqXEqBr23uBYI18GJSJzqOLnoxBwgFMv3hcrx2ebpS4Z+JDQ2CobzYv fmF13SAPCrynPdAnebV9Tyg73K1PCKECmovEBMSKMHB+mGKuoLPM9ALZb/Jw1jFwQVa9 swGxwXGt1KUWrlctdnCsKmpFUC0gP93WXdJVM= Received: by 10.229.43.1 with SMTP id u1mr3979326qce.214.1306344261097; Wed, 25 May 2011 10:24:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.226.77 with HTTP; Wed, 25 May 2011 10:24:01 -0700 (PDT) In-Reply-To: <1306342228-sup-2964@alvh.no-ip.org> References: <4DD28F73.6010108@25th-floor.com> <25017.1306291669@sss.pgh.pa.us> <4DDCA801.70805@25th-floor.com> <19738.1306338472@sss.pgh.pa.us> <1306339028-sup-6948@alvh.no-ip.org> <22173.1306340636@sss.pgh.pa.us> <4DDCE9F4020000250003DC48@gw.wicourts.gov> <1306342228-sup-2964@alvh.no-ip.org> From: =?ISO-8859-1?Q?C=E9dric_Villemain?= Date: Wed, 25 May 2011 19:24:01 +0200 Message-ID: Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum To: Alvaro Herrera Cc: Kevin Grittner , Tom Lane , Florian Helmberger , pgsql-hackers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201105/1295 X-Sequence-Number: 188329 2011/5/25 Alvaro Herrera : > Excerpts from Kevin Grittner's message of mi=E9 may 25 12:37:24 -0400 201= 1: >> Tom Lane wrote: >> >> > I don't know what client-side code might be looking at >> > relpages/reltuples. >> >> I know that I find reltuples useful for getting an "accurate enough" >> sense of rows in a table (or set of tables) without resorting to >> count(*). =A0I'd be OK with any two of pages, tuples, and density; but >> dropping to one would make databases harder to manage, IMV. >> >> Personally, I don't have much code that uses those columns; >> eliminating an existing column wouldn't involve much pain for me as >> long as it could still be derived. > > Well, we only actually need to store one number, because you can figure > out a much more precise number-of-pages figure with pg_relation_size() > divided by configured page size. > > (We feel free to hack around catalogs in other places, and we regularly > break pgAdmin and the like when we drop columns -- people just live with > it and update their tools. =A0I don't think it's such a big deal in this > particular case.) I may miss something but we need relation size in costsize.c even if we have a reldensity (or we need a reltuples). Else what values should be used to estimate the relation size ? (pg_relation_size() goes down to kernel/fs to ask the stat.st_size, is it really what we want?) > > -- > =C1lvaro Herrera > The PostgreSQL Company - Command Prompt, Inc. > PostgreSQL Replication, Consulting, Custom Development, 24x7 support > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers > --=20 C=E9dric Villemain=A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 2ndQuadrant http://2ndQuadrant.fr/=A0 =A0=A0 PostgreSQL : Expertise, Formation et Suppo= rt