pgsql: Remove explicit FreeExprContext calls during plan node shutdown. - Mailing list pgsql-committers

From tgl@svr1.postgresql.org (Tom Lane)
Subject pgsql: Remove explicit FreeExprContext calls during plan node shutdown.
Date
Msg-id 20050423213234.F165053877@svr1.postgresql.org
Whole thread Raw
List pgsql-committers
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)

pgsql-committers by date:

Previous
From: momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Done: < * Optimize locale to have minimal performance impact
Next
From: momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Done: < * Improve SMP performance on i386 machines > * -Improve