摘要:
Path的定义:/* * Type "Path" is used as-is for sequential-scan paths, as well as some other * simple plan types that we don't need any extra information in the path for. * For other path types it is the first component of a larger struct. * * "pathtype" is the NodeTag of the Plan 阅读全文
摘要:
此处,分析 add_paths_to_joinrel:/* * add_paths_to_joinrel * Given a join relation and two component rels from which it can be made, * consider all possible paths that use the two component rels as outer * and inner rel respectively. Add these paths to the join rel's pathlist * if the... 阅读全文
摘要:
其代码结构:/* * build_join_rel * Returns relation entry corresponding to the union of two given rels, * creating a new relation entry if none already exists. * * 'joinrelids' is the Relids set that uniquely identifies the join * 'outer_rel' and 'inner_rel' are relation nodes for t 阅读全文
摘要:
对RelOptInfo *make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2) 函数进行研究:看看 inner join 时候发生的事情:RelOptInfo *make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2){ ... SpecialJoinInfo *sjinfo; ... /* Check validity and determine join type. */ if (!join_is_legal... 阅读全文
摘要:
在PostgreSQL的源代码中,有如下调用关系:query_planner -->generate_base_implied_equalities -->generate_base_implied_qualities_const -->process_implied_equality -->distribute_qual_to_relsdistribute_qual_to_rels的函数定义如下:static voiddistribute_qual_to_rels(PlannerInfo *root, Node *clause, ... 阅读全文
摘要:
以A表和B表的连接而言:A.col=B.colJOIN_INNER: 就是等值连接。找出A中有,B中也有,A和B的对应字段相等的记录的信息。postgres=# select * from sales s inner join customers c on s.cust_id = c.cust_id; cust_id | item | cust_id | cust_name ---------+----------+---------+----------- 2 | camera | 2 | John Doe 3 | computer | ... 阅读全文