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: | 20100104024440.7C621753FB7@cvs.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers pgsql-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:
--------------
pgsql/src/backend/executor:
nodeHash.c (r1.125 -> r1.126)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeHash.c?r1=1.125&r2=1.126)
pgsql/src/backend/tsearch:
ts_selfuncs.c (r1.6 -> r1.7)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tsearch/ts_selfuncs.c?r1=1.6&r2=1.7)
pgsql/src/backend/utils/adt:
selfuncs.c (r1.266 -> r1.267)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/selfuncs.c?r1=1.266&r2=1.267)
pgsql/src/backend/utils/cache:
lsyscache.c (r1.165 -> r1.166)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/lsyscache.c?r1=1.165&r2=1.166)
pgsql/src/include/utils:
lsyscache.h (r1.130 -> r1.131)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/lsyscache.h?r1=1.130&r2=1.131)
From | Date | Subject | |
---|---|---|---|
Next Message | User Mhasegawa | 2010-01-04 07:41:56 | pgbulkload - pgbulkload: Add pgut-be header file. |
Previous Message | Takahiro Itagaki | 2010-01-04 01:06:21 | pgsql: Silence compiler warning about printf format for HANDLE. |
From | Date | Subject | |
---|---|---|---|
Next Message | Takahiro Itagaki | 2010-01-04 02:50:56 | Re: New VACUUM FULL |
Previous Message | Takahiro Itagaki | 2010-01-04 02:10:07 | Re: pg_read_file() and non-ascii input file |