Skip site navigation (1) Skip section navigation (2)

pgsql: When estimating the selectivity of an inequality "column >

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: When estimating the selectivity of an inequality "column >
Date: 2010-01-04 02:44:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committerspgsql-hackers
Log Message:
When estimating the selectivity of an inequality "column > constant" or
"column < constant", and the comparison value is in the first or last
histogram bin or outside the histogram entirely, try to fetch the actual
column min or max value using an index scan (if there is an index on the
column).  If successful, replace the lower or upper histogram bound with
that value before carrying on with the estimate.  This limits the
estimation error caused by moving min/max values when the comparison
value is close to the min or max.  Per a complaint from Josh Berkus.

It is tempting to consider using this mechanism for mergejoinscansel as well,
but that would inject index fetches into main-line join estimation not just
endpoint cases.  I'm refraining from that until we can get a better handle
on the costs of doing this type of lookup.

Modified Files:
        nodeHash.c (r1.125 -> r1.126)
        ts_selfuncs.c (r1.6 -> r1.7)
        selfuncs.c (r1.266 -> r1.267)
        lsyscache.c (r1.165 -> r1.166)
        lsyscache.h (r1.130 -> r1.131)


pgsql-hackers by date

Next:From: Takahiro ItagakiDate: 2010-01-04 02:50:56
Subject: Re: New VACUUM FULL
Previous:From: Takahiro ItagakiDate: 2010-01-04 02:10:07
Subject: Re: pg_read_file() and non-ascii input file

pgsql-committers by date

Next:From: User MhasegawaDate: 2010-01-04 07:41:56
Subject: pgbulkload - pgbulkload: Add pgut-be header file.
Previous:From: Takahiro ItagakiDate: 2010-01-04 01:06:21
Subject: pgsql: Silence compiler warning about printf format for HANDLE.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group