On Sat, Nov 30, 2002 at 11:05:01AM -0500, Tom Lane wrote:
> >> The planner doesn't know what value data_off will be compared to at
> >> runtime, so it has to fall back on a default selectivity estimate.
> > strange - is there no way we can "teach" him, that this is a constant. i
> > mean now() - '31 days'::interval will be exactly the same for all rows
> > of auction,
> It knows that. What it doesn't know is how many rows of the table the
> query is going to select, and that is exactly the thing it needs to know
> to choose seqscan vs. indexscan.
than what purpose serves pg_stats? i belive it could be used to estimate
number of rows returned.
if i know that i will be comparing <field> with some <value>, and i'm
able to tell the value, i should be able to look in pg_stats to estimate
rowcount.
what am i missing?
depesz
--
hubert depesz lubaczewski http://www.depesz.pl/
------------------------------------------------------------------------
Mój Boże, spraw abym milczał, dopóki się nie upewnię, że naprawdę mam
coś do powiedzenia. (c) 1998 depesz