Thread: pgsql: Remove explicit FreeExprContext calls during plan node shutdown.

pgsql: Remove explicit FreeExprContext calls during plan node shutdown.

From
tgl@svr1.postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Remove explicit FreeExprContext calls during plan node shutdown.  The
ExprContexts will be freed anyway when FreeExecutorState() is reached,
and letting that routine do the work is more efficient because it will
automatically free the ExprContexts in reverse creation order.  The
existing coding was effectively freeing them in exactly the worst
possible order, resulting in O(N^2) behavior inside list_delete_ptr,
which becomes highly visible in cases with a few thousand plan nodes.

ExecFreeExprContext is now effectively a no-op and could be removed,
but I left it in place in case we ever want to put it back to use.

Modified Files:
--------------
    pgsql/src/backend/executor:
        execUtils.c (r1.121 -> r1.122)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execUtils.c.diff?r1=1.121&r2=1.122)
        nodeBitmapIndexscan.c (r1.3 -> r1.4)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeBitmapIndexscan.c.diff?r1=1.3&r2=1.4)
        nodeIndexscan.c (r1.100 -> r1.101)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeIndexscan.c.diff?r1=1.100&r2=1.101)