上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 104 下一页
摘要: 在PostgreSQL运行的时候,通过对其代码进行跟踪,发现不断有进程被生成,访问InitFileAccess,过了大约20秒左右,就死掉了。这个过程反复地进行着,进程号不断增加。我对其进一步进行了跟踪,发现似乎是这些进程是为了 autovacuum 而被创建出来,然后自己消亡的。在PostgreSQL9.2源代码中加入:InitFileAccess(void){ fprintf(stderr,"In %s ...by Process %d\n", __FUNCTION__,getpid()); fprintf(stderr,"------------------ 阅读全文
posted @ 2013-05-24 14:45 健哥的数据花园 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 我个人的理解:其实质,和Java里的Hash表有点类似。在C语言中是为了解决数组无法扩展的缺陷。例子:看 PostgreSQL对 VFD的处理:初始化:/* * Virtual File Descriptor array pointer and size. This grows as * needed. 'File' values are indexes into this array. * Note that VfdCache[0] is not a usable VFD, just a list header. */static Vfd *VfdCache;static S 阅读全文
posted @ 2013-05-24 08:18 健哥的数据花园 阅读(472) 评论(0) 推荐(0) 编辑
摘要: 继续:/* * estimate_rel_size - estimate # pages and # tuples in a table or index * * We also estimate the fraction of the pages that are marked all-visible in * the visibility map, for use in estimation of index-only scans. * * If attr_widths isn't NULL, it points to the zero-index entry of the * r 阅读全文
posted @ 2013-05-23 15:40 健哥的数据花园 阅读(602) 评论(0) 推荐(0) 编辑
摘要: 接着分析:build_simple_rel 函数/* * build_simple_rel * Construct a new RelOptInfo for a base relation or 'other' relation. */RelOptInfo *build_simple_rel(PlannerInfo *root, int relid, RelOptKind reloptkind){ ... /* Check type of rtable entry */ switch (rte->rtekind) { case RTE_RELAT... 阅读全文
posted @ 2013-05-23 15:22 健哥的数据花园 阅读(489) 评论(0) 推荐(0) 编辑
摘要: 如此:接前面,看 add_base_rels_to_query函数:/* * add_base_rels_to_query * * Scan the query's jointree and create baserel RelOptInfos for all * the base relations (ie, table, subquery, and function RTEs) * appearing in the jointree. * * The initial invocation must pass root->parse->jointree as t... 阅读全文
posted @ 2013-05-23 15:06 健哥的数据花园 阅读(343) 评论(0) 推荐(0) 编辑
摘要: Path莫非指的就是 物理访问路径?/* * query_planner * Generate a path (that is, a simplified plan) for a basic query, * which may involve joins but not any fancier features. * * Since query_planner does not handle the toplevel processing (grouping, * sorting, etc) it cannot select the best path by itself... 阅读全文
posted @ 2013-05-23 14:36 健哥的数据花园 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 继续:/*-------------------- * grouping_planner * Perform planning steps related to grouping, aggregation, etc. * This primarily means adding top-level processing to the basic * query plan produced by query_planner. * * tuple_fraction is the fraction of tuples we expect will be retrieved... 阅读全文
posted @ 2013-05-23 13:56 健哥的数据花园 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 接前面,对 subquery_planner,进行进一步的分析:/*-------------------- * subquery_planner * Invokes the planner on a subquery. We recurse to here for each * sub-SELECT found in the query tree. * * glob is the global state for the current planner run. * parse is the querytree produced by the parser & rewr... 阅读全文
posted @ 2013-05-23 13:21 健哥的数据花园 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 接前面,继续进行分析:前面已经说过,在planner函数运行时,发生了实际物理磁盘访问。/***************************************************************************** * * Query optimizer entry point * * To support loadable plugins that monitor or modify planner behavior, * we provide a hook variable that lets a plugin get control before... 阅读全文
posted @ 2013-05-23 13:09 健哥的数据花园 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 回到 exec_simple_query函数上来。/* * exec_simple_query * * Execute a "simple Query" protocol message. */static voidexec_simple_query(const char *query_string){ ... start_xact_command(); ... parsetree_list = pg_parse_query(query_string); ... /* * Run through the raw parsetree(s) an... 阅读全文
posted @ 2013-05-23 10:12 健哥的数据花园 阅读(462) 评论(0) 推荐(0) 编辑
上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 104 下一页