Обсуждение: pgsql: Improve INTERSECT/EXCEPT hashing by realizing that we don't need

Поиск
Список
Период
Сортировка

pgsql: Improve INTERSECT/EXCEPT hashing by realizing that we don't need

От
tgl@postgresql.org (Tom Lane)
Дата:
Log Message:
-----------
Improve INTERSECT/EXCEPT hashing by realizing that we don't need to make any
hashtable entries for tuples that are found only in the second input: they
can never contribute to the output.  Furthermore, this implies that the
planner should endeavor to put first the smaller (in number of groups) input
relation for an INTERSECT.  Implement that, and upgrade prepunion's estimation
of the number of rows returned by setops so that there's some amount of sanity
in the estimate of which one is smaller.

Modified Files:
--------------
    pgsql/src/backend/executor:
        nodeSetOp.c (r1.26 -> r1.27)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeSetOp.c?r1=1.26&r2=1.27)
    pgsql/src/backend/nodes:
        copyfuncs.c (r1.398 -> r1.399)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c?r1=1.398&r2=1.399)
        outfuncs.c (r1.332 -> r1.333)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c?r1=1.332&r2=1.333)
    pgsql/src/backend/optimizer/plan:
        createplan.c (r1.243 -> r1.244)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/createplan.c?r1=1.243&r2=1.244)
    pgsql/src/backend/optimizer/prep:
        prepunion.c (r1.151 -> r1.152)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepunion.c?r1=1.151&r2=1.152)
    pgsql/src/backend/optimizer/util:
        tlist.c (r1.80 -> r1.81)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/tlist.c?r1=1.80&r2=1.81)
    pgsql/src/include/nodes:
        plannodes.h (r1.101 -> r1.102)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/plannodes.h?r1=1.101&r2=1.102)
    pgsql/src/include/optimizer:
        planmain.h (r1.109 -> r1.110)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/planmain.h?r1=1.109&r2=1.110)
        tlist.h (r1.51 -> r1.52)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/tlist.h?r1=1.51&r2=1.52)