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

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: When estimating the selectivity of an inequality "column >
Дата
Msg-id 20100104024440.7C621753FB7@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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)

В списке pgsql-committers по дате отправления:

Предыдущее
От: itagaki@postgresql.org (Takahiro Itagaki)
Дата:
Сообщение: pgsql: Silence compiler warning about printf format for HANDLE.
Следующее
От: mhasegawa@pgfoundry.org (User Mhasegawa)
Дата:
Сообщение: pgbulkload - pgbulkload: Add pgut-be header file.