pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Cédric Villemain <cedric.villemain.debian@gmail.com>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Kevin Grittner <kevin.grittner@wicourts.gov>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Florian Helmberger <fh@25th-floor.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum
Date: Wed, 25 May 2011 21:14:06 +0200
Message-ID: <BANLkTinKDYoBo8ZpreagS3E5wkfL5zYNcg@mail.gmail.com> (raw)
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>
	<BANLkTimyfvQXsLswzBCV5PFi+NN_TeDZ+g@mail.gmail.com>
	<1306344946-sup-417@alvh.no-ip.org>

2011/5/25 Alvaro Herrera <alvherre@commandprompt.com>:
> Excerpts from Cédric Villemain's message of mié may 25 13:24:01 -0400 2011:
>
>> > 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.
>
>> 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 :)

>
> --
> Álvaro Herrera <alvherre@commandprompt.com>
> The PostgreSQL Company - Command Prompt, Inc.
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
>



-- 
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support



view thread (48+ messages)  latest in thread

Message-ID: <BANLkTinKDYoBo8ZpreagS3E5wkfL5zYNcg@mail.gmail.com>
Permalink:  ../BANLkTinKDYoBo8ZpreagS3E5wkfL5zYNcg@mail.gmail.com/
Also on:    postgresql.org/message-id/BANLkTinKDYoBo8ZpreagS3E5wkfL5zYNcg@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: cedric.villemain.debian@gmail.com, alvherre@commandprompt.com, kevin.grittner@wicourts.gov, tgl@sss.pgh.pa.us, fh@25th-floor.com, pgsql-hackers@postgresql.org
  Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum
  In-Reply-To: <BANLkTinKDYoBo8ZpreagS3E5wkfL5zYNcg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox