因毕业设计需要,现在要在postgresql上加一小点算法,但是因为我不懂他的源码,一点一点看的话有太多了,所以想请高手指点迷津,具体是这样的:现在要在实现XPathLearner中的简单路径表达式算法,我估计是这样的,先要在querytree_list中加入简单路径表达式的tree,然后在pg_plan_queries中新增计算简单路径表达式的选择读的算法,然后和现有的querytree算法比较,返回最优的算法postgres.c中有代码如下/*
 * OK to analyze, rewrite, and plan this query.
 *
 * Switch to appropriate context for constructing querytrees (again,
 * these must outlive the execution context).
 */
oldcontext = MemoryContextSwitchTo(MessageContext); querytree_list = pg_analyze_and_rewrite(parsetree, query_string,
NULL, 0); plantree_list = pg_plan_queries(querytree_list, 0, NULL, false); /* Done with the snapshot used for parsing/planning */
高手们能发表一下意见该怎么做吗,只剩82分了全部奉上,谢谢