Re: WIP patch: distinguish selectivity of < from <= and > from >=

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2017-07-05T22:15:24Z
Lists: pgsql-hackers

Attachments

I wrote:
> (Pokes at it some more...) Oh, interesting: it behaves that way except
> when p is exactly the lowest histogram entry.

Here's a revised version that addresses that point and cleans up some
other minor details about treatment of cases near the histogram endpoints.
I'm still pretty unclear on exactly why it works (see XXX comments in
patch), but testing shows that it does work very well indeed given a flat
data distribution.  On less-flat distributions, you get some estimation
errors, but that's neither new nor surprising.

			regards, tom lane

Commits

  1. Distinguish selectivity of < from <= and > from >=.