Re: strange pg_stats behaviour? - Mailing list pgsql-general

From Hubert depesz Lubaczewski
Subject Re: strange pg_stats behaviour?
Date
Msg-id 20021130185107.GA5814@depesz.pl
Whole thread Raw
In response to Re: strange pg_stats behaviour?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: strange pg_stats behaviour?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: vacuum full analyze problem
Next
From: Jochem van Dieten
Date:
Subject: USAGE on schema allowed by default?