pgsql: Fix the plan-invalidation mechanism to treat regclass constants - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix the plan-invalidation mechanism to treat regclass constants
Date
Msg-id 20071011180527.A314A753E4C@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix the plan-invalidation mechanism to treat regclass constants that refer to
a relation as a reason to invalidate a plan when the relation changes.  This
handles scenarios such as dropping/recreating a sequence that is referenced by
nextval('seq') in a cached plan.  Rather than teach plancache.c all about
digging through plan trees to find regclass Consts, we charge the planner's
setrefs.c with making a list of the relation OIDs on which each plan depends.
That way the list can be built cheaply during a plan tree traversal that has
to happen anyway.  Per bug #3662 and subsequent discussion.

Modified Files:
--------------
    pgsql/src/backend/nodes:
        copyfuncs.c (r1.382 -> r1.383)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c?r1=1.382&r2=1.383)
        outfuncs.c (r1.314 -> r1.315)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c?r1=1.314&r2=1.315)
    pgsql/src/backend/optimizer/plan:
        planner.c (r1.222 -> r1.223)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c?r1=1.222&r2=1.223)
        setrefs.c (r1.136 -> r1.137)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/setrefs.c?r1=1.136&r2=1.137)
    pgsql/src/backend/utils/cache:
        plancache.c (r1.11 -> r1.12)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/plancache.c?r1=1.11&r2=1.12)
    pgsql/src/include/nodes:
        plannodes.h (r1.95 -> r1.96)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/plannodes.h?r1=1.95&r2=1.96)
        relation.h (r1.146 -> r1.147)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/relation.h?r1=1.146&r2=1.147)
    pgsql/src/include/optimizer:
        planmain.h (r1.102 -> r1.103)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/planmain.h?r1=1.102&r2=1.103)
    pgsql/src/test/regress/expected:
        plancache.out (r1.4 -> r1.5)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/plancache.out?r1=1.4&r2=1.5)
    pgsql/src/test/regress/sql:
        plancache.sql (r1.4 -> r1.5)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/plancache.sql?r1=1.4&r2=1.5)

pgsql-committers by date:

Previous
From: mkz@pgfoundry.org (User Mkz)
Date:
Subject: plproxy - plproxy: experimantal server parameter syncing
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Remove incorrect use of VARSIZE() on a toasted datum.