pgsql: Rewrite the planner's handling of materialized plan types so that - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Rewrite the planner's handling of materialized plan types so that
Date
Msg-id 20090912221209.8E3E7753FB7@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Rewrite the planner's handling of materialized plan types so that there is
an explicit model of rescan costs being different from first-time costs.
The costing of Material nodes in particular now has some visible relationship
to the actual runtime behavior, where before it was essentially fantasy.
This also fixes up a couple of places where different materialized plan types
were treated differently for no very good reason (probably just oversights).

A couple of the regression tests are affected, because the planner now chooses
to put the other relation on the inside of a nestloop-with-materialize.
So far as I can see both changes are sane, and the planner is now more
consistently following the expectation that it should prefer to materialize
the smaller of two relations.

Per a recent discussion with Robert Haas.

Modified Files:
--------------
    pgsql/src/backend/executor:
        execAmi.c (r1.103 -> r1.104)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execAmi.c?r1=1.103&r2=1.104)
    pgsql/src/backend/optimizer/path:
        costsize.c (r1.210 -> r1.211)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/costsize.c?r1=1.210&r2=1.211)
        joinpath.c (r1.122 -> r1.123)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/joinpath.c?r1=1.122&r2=1.123)
    pgsql/src/backend/optimizer/plan:
        createplan.c (r1.261 -> r1.262)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/createplan.c?r1=1.261&r2=1.262)
        subselect.c (r1.152 -> r1.153)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/subselect.c?r1=1.152&r2=1.153)
    pgsql/src/backend/optimizer/util:
        pathnode.c (r1.152 -> r1.153)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/pathnode.c?r1=1.152&r2=1.153)
    pgsql/src/include/executor:
        executor.h (r1.158 -> r1.159)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/executor.h?r1=1.158&r2=1.159)
    pgsql/src/include/optimizer:
        cost.h (r1.97 -> r1.98)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/cost.h?r1=1.97&r2=1.98)
    pgsql/src/test/regress/expected:
        geometry.out (r1.26 -> r1.27)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/geometry.out?r1=1.26&r2=1.27)
        geometry_1.out (r1.11 -> r1.12)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/geometry_1.out?r1=1.11&r2=1.12)
        geometry_2.out (r1.8 -> r1.9)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/geometry_2.out?r1=1.8&r2=1.9)
        join.out (r1.40 -> r1.41)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/join.out?r1=1.40&r2=1.41)

pgsql-committers by date:

Previous
From: Mark Mielke
Date:
Subject: Re: Can not create more than 32766 databases in ufs file system.
Next
From: petere@postgresql.org (Peter Eisentraut)
Date:
Subject: pgsql: Add Unicode support in PL/Python PL/Python now accepts Unicode