Re: regression in analyze - Mailing list pgsql-hackers

From Matteo Beccati
Subject Re: regression in analyze
Date
Msg-id 4913FA6F.8010608@beccati.com
Whole thread Raw
In response to regression in analyze  ("Jaime Casanova" <jcasanov@systemguards.com.ec>)
List pgsql-hackers
Hi,

>              * We approximate "never vacuumed" by "has relpages = 0", which
>              * means this will also fire on genuinely empty relations.  Not
>              * great, but fortunately that's a seldom-seen case in the real
>              * world, and it shouldn't degrade the quality of the plan too
>              * much anyway to err in this direction.
>              */
>             if (curpages < 10 && rel->rd_rel->relpages == 0)
>                 curpages = 10;
> 
> 
> commenting that two lines make the estimates correct. now that we have
> plan invalidation that hack is still needed?
> i know that as the comment suggest this has no serious impact but
> certainly this is user visible.

I guess the reason is that a 0 estimate for a non empty table which was
analyzed before the data was inserted and not yet analyzed again could
cause much more troubles... anyway, I was just curious to get an
"official" anwser ;)


Cheers

-- 
Matteo Beccati

OpenX - http://www.openx.org


pgsql-hackers by date:

Previous
From: "Robert Haas"
Date:
Subject: Re: array_length()
Next
From: Magnus Hagander
Date:
Subject: Re: Final /contrib cleanup -- yes/no?