Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id EAFD5B5DC4F for ; Wed, 25 May 2011 16:14:33 -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 42751-01 for ; Wed, 25 May 2011 19:14:26 +0000 (UTC) X-Greylist: from auto-whitelisted 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 633C7B5DC49 for ; Wed, 25 May 2011 16:14:26 -0300 (ADT) Received: by qyg14 with SMTP id 14so4681774qyg.19 for ; Wed, 25 May 2011 12:14:26 -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=mxVQ+BFHVfPmphVERLumkJrMbvy546sVfgOggHg/ZM8=; b=s5jBdcQdi7qX+1OfgBeax9WyI1JH2sj3PreWHJo1NCgmJIQP8ul+EduX/zyTwmwLic DoP8MNx492mtIvlewBX8XpcL3bLVe+mEHwG4/PZthSTwOFVMP18Por/F24Vzr2Z4Nkpk HyrcJ5kpX96rbvuQvN3CiCmV3NQgVYjAFyDV0= 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=WC8IbM41foIdqyhMiEqBlj5P7HCMwKpOsvA31DWO6a/thP95slO2KSLVmUeFWw2N0I eHK2qSOzpMQlPeyU8NjTkGVK3tGeTiZwkP7F3k9BiNxXZwReGPTkDnrrjoQfUrwqLUKj 1YSHqedVRq/GV4Hl/dSJIOelf2q2avX5bpjbw= Received: by 10.229.62.198 with SMTP id y6mr4049196qch.290.1306350866116; Wed, 25 May 2011 12:14:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.226.77 with HTTP; Wed, 25 May 2011 12:14:06 -0700 (PDT) In-Reply-To: <1306344946-sup-417@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> <1306344946-sup-417@alvh.no-ip.org> From: =?ISO-8859-1?Q?C=E9dric_Villemain?= Date: Wed, 25 May 2011 21:14:06 +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/1314 X-Sequence-Number: 188348 2011/5/25 Alvaro Herrera : > Excerpts from C=E9dric Villemain's message of mi=E9 may 25 13:24:01 -0400= 2011: > >> > Well, we only actually need to store one number, because you can figur= e >> > out a much more precise number-of-pages figure with pg_relation_size() >> > divided by configured page size. > >> 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?) > > Actually yes, the planner does go to kernel to determine the current > relation size, and then multiplies by density as computed from catalog > data to figure out current reasonably accurate number of tuples. Okay! I just read that part. Interesting. (If I dive correctly, we search our last segment and then use a fileseek to the end of this segment to get our information) make more sense, suddendly :) > > -- > =C1lvaro Herrera > The PostgreSQL Company - Command Prompt, Inc. > PostgreSQL Replication, Consulting, Custom Development, 24x7 support > --=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