pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: judging acceptable discrepancy in row count v. estimate
Date: Tue, 16 Oct 2018 14:07:04 -0600
Message-ID: <65FFDBB8-23F3-46F4-81CD-2748B271EA58@gmail.com> (raw)
In-Reply-To: <24387.1539716472@sss.pgh.pa.us>
References: <37AF5C49-8550-4738-912D-859F685DB3D4@gmail.com>
	<24387.1539716472@sss.pgh.pa.us>



> On Oct 16, 2018, at 1:01 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Rob Sargent <robjsargent@gmail.com> writes:
>> Should reality be half again as large as the estimated row count?
>> coon=# select count(*) from sui.segment;
>>  count   
>> ----------
>> 49,942,837  -- my commas
>> (1 row)
> 
>> coon=# vacuum (analyse, verbose) sui.probandset;
> 
> Uh, what does sui.probandset have to do with sui.segment ?
> 
> 			regards, tom lane

In fullness, 

INFO:  analyzing "sui.segment"
INFO:  "segment": scanned 30000 of 1019242 pages, containing 1470000 live rows and 0 dead rows; 30000 rows in sample, 49942858 estimated total rows
VACUUM
Time: 321934.748 ms (05:21.935)

So, rather accurately estimated (no inserts, deletes) since bogus report.  Looks like its good to 5+ decimal places, given sufficient records.

select 49942858.0/49942837.0;
        ?column?        
------------------------
 1.00000042048071878656
(1 row)

This table has no variable length columns. I imagine that helps.





view thread (4+ messages)

Message-ID: <65FFDBB8-23F3-46F4-81CD-2748B271EA58@gmail.com>
Permalink:  ../65FFDBB8-23F3-46F4-81CD-2748B271EA58@gmail.com/
Also on:    postgresql.org/message-id/65FFDBB8-23F3-46F4-81CD-2748B271EA58@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: judging acceptable discrepancy in row count v. estimate
  In-Reply-To: <65FFDBB8-23F3-46F4-81CD-2748B271EA58@gmail.com>
  References: <37AF5C49-8550-4738-912D-859F685DB3D4@gmail.com> <24387.1539716472@sss.pgh.pa.us> <65FFDBB8-23F3-46F4-81CD-2748B271EA58@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