Re: strange row number estimates in pg9.1rc1 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: strange row number estimates in pg9.1rc1
Date
Msg-id 8234.1314682478@sss.pgh.pa.us
Whole thread Raw
In response to strange row number estimates in pg9.1rc1  ("Sergey E. Koposov" <math@sai.msu.ru>)
Responses Re: strange row number estimates in pg9.1rc1
List pgsql-hackers
"Sergey E. Koposov" <math@sai.msu.ru> writes:
> I'm seeing something weird which looks like a bug in 9.1rc1 after the 
> upgrade 8.4->9.0->9.1 done using pg_upgrade.

Hm, I wonder what pg_upgrade left relpages/reltuples set to ...

> INFO:  "lassource": found 0 removable, 0 nonremovable row versions in 0 
> out of 6451184 pages

VACUUM is deciding that the table is all-visible and it need not scan
any of it ...

> INFO:  "lassource": scanned 30000 of 6451184 pages, containing 270000 live 
> rows and 0 dead rows; 30000 rows in sample, 806239 estimated total rows

... and then ANALYZE is scanning only 30000 of 6451184 pages, so even
though it knows the correct tuple density in those pages, it's not
licensed to change the reltuples total very much.  If reltuples is way
off base to start with, then it will take a lot of ANALYZE cycles to
converge on a saner value.  However, this doesn't leave us much closer
to understanding why it's off base to start with.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: spinlocks on HP-UX
Next
From: Heikki Linnakangas
Date:
Subject: Re: WIP: Fast GiST index build