Re: Risk Estimation WAS: Planner hints in Postgresql - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Risk Estimation WAS: Planner hints in Postgresql
Date
Msg-id 23908.1395168119@sss.pgh.pa.us
Whole thread Raw
In response to Re: Risk Estimation WAS: Planner hints in Postgresql  (Atri Sharma <atri.jiit@gmail.com>)
Responses Re: Risk Estimation WAS: Planner hints in Postgresql  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Atri Sharma <atri.jiit@gmail.com> writes:
> One of the factors that leads to bad estimates is that the histogram of the
> values of a column maintained by the planner gets old by time and the data
> in the column changes. So, the histogram is no longer a quite accurate view
> of the data and it leads to bad selectivity.

TBH, this is so far down the list of problems that it'll be a long time
before we need to worry about it.  It's certainly not the number one
priority for any project to model risk in the planner.

The thing that I think is probably the number one problem is estimates
that depend on an assumption of uniform distribution of sought-after rows
among those encountered by a scan.  This is usually where bad plans for
LIMIT queries are coming from.  We could certainly add some sort of fudge
factor to those costs, but I'd like to have a more-or-less principled
framework for doing so.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Wiki Page Draft for upcoming release
Next
From: Alvaro Herrera
Date:
Subject: Re: pg_archivecleanup bug