摘要: postgres=# select FindCourse('aaaa');ERROR: cannot begin/end transactions in PL/pgSQLHINT: Use a BEGIN block with an EXCEPTION clause instead.CONTEXT: PL/pgSQL function findcourse(character varying) line 21 at SQL statement出现这种错误的原因是:看我改后的代码:[postgres@lex pgsql]$ cat ./data/test.sqlCREATE OR 阅读全文
posted @ 2013-06-07 17:24 健哥的数据花园 阅读(5561) 评论(0) 推荐(0)
摘要: 接着追踪->pathlist:初始化可能是在这里完成的?/* * add_path * Consider a potential implementation path for the specified parent rel, * and add it to the rel's pathlist if it is worthy of consideration. * A path is worthy if it has a better sort order (better pathkeys) or * cheaper cost (on either ... 阅读全文
posted @ 2013-06-07 14:58 健哥的数据花园 阅读(285) 评论(0) 推荐(0)
摘要: 接前面,继续分析 : cheapest_startup_path = cheapest_total_path = NULL; have_parameterized_paths = false; foreach(p, parent_rel->pathlist) { Path *path = (Path *) lfirst(p); int cmp; /* We only consider unparameterized paths in this step */ if (path->p... 阅读全文
posted @ 2013-06-07 13:09 健哥的数据花园 阅读(337) 评论(0) 推荐(0)
摘要: 接前面。从 cheapest_total_path 来看:query_planner 会先调用 build_simple_rel,这里完成了 cheapest_total_path 的初始化。(query_planner --> add_base_rels_to_query --> query_planner)然后,query_planner 再在后面调用 create_plan,最终设置 plan_rows。那么,是在何处 设置了 cheapest_total_path 的值呢?经过查找,看到了如下的调用关系:make_one_rel--> set_base_rel_pat 阅读全文
posted @ 2013-06-07 09:25 健哥的数据花园 阅读(406) 评论(0) 推荐(0)