Re: judging acceptable discrepancy in row count v. estimate - Mailing list pgsql-general

From Rob Sargent
Subject Re: judging acceptable discrepancy in row count v. estimate
Date
Msg-id 65FFDBB8-23F3-46F4-81CD-2748B271EA58@gmail.com
Whole thread Raw
In response to Re: judging acceptable discrepancy in row count v. estimate  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general

> 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,
49942858estimated 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,
givensufficient records. 

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

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



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: FATAL: terminating connection because protocol synchronizationwas lost
Next
From: Ravi Krishna
Date:
Subject: postgres server process crashes when using odbc_fdw