Dumb Micro-Optimization
Dumb Micro-Optimization
От:
PFC <lists@peufeu.com>
Дата:
* Dumb Optimization #1: - Add executorFunc function pointer to struct PlanState - in ExecProcNode.c -> ExecProcNode() :- upon first execution, set executorFunc to the function corresponding to node type- next calls use function pointer Effect : removes a switch (nodeTag(node)) which otherwise executes for every tuple returned by every node Gain : - 4% CPU time on SELECT sum(an integer column) FROM a table of one million rows - nil on selects returning few rows obviously