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(root, rel1, rel2, joinrelids,&sjinfo, &reversed)).../** If it's a plain inner join, then we won't have found anything in* join_info_list.    Make up a SpecialJoinInfo so that selectivity* estimation functions will know what's being joined.*/if (sjinfo == NULL){
        sjinfo = &sjinfo_data;sjinfo->type = T_SpecialJoinInfo;sjinfo->min_lefthand = rel1->relids;sjinfo->min_righthand = rel2->relids;sjinfo->syn_lefthand = rel1->relids;sjinfo->syn_righthand = rel2->relids;sjinfo->jointype = JOIN_INNER;/* we don't bother trying to make the remaining fields valid */sjinfo->lhs_strict = false;sjinfo->delay_upper_joins = false;sjinfo->join_quals = NIL;}...switch (sjinfo->jointype){case JOIN_INNER:fprintf(stderr,"JOIN_INNER \n");if (is_dummy_rel(rel1) || is_dummy_rel(rel2) ||restriction_is_constant_false(restrictlist, false)){mark_dummy_rel(joinrel);break;}add_paths_to_joinrel(root, joinrel, rel1, rel2,JOIN_INNER, sjinfo,restrictlist);add_paths_to_joinrel(root, joinrel, rel2, rel1,JOIN_INNER, sjinfo,restrictlist);break;...}...
}

转载于:https://www.cnblogs.com/gaojian/archive/2013/06/13/3133872.html

PostgreSQL在何处处理 sql查询之六十二相关推荐

  1. PostgreSQL在何处处理 sql查询之六十六

    继续分析 /** final_cost_hashjoin* Final estimate of the cost and result size of a hashjoin path.** Note: ...

  2. PostgreSQL在何处处理 sql查询之五十二

    开始 /** Ready to do the primary planning.*/final_rel = make_one_rel(root, joinlist); 展开: /** make_one ...

  3. PostgreSQL在何处处理 sql查询之十二

    接前面,对 subquery_planner,进行进一步的分析: /*--------------------* subquery_planner* Invokes the planner on a ...

  4. PostgreSQL在何处处理 sql查询之五十四

    接前面,从 cheapeast_path 的角度,关注 query_planner 函数,对其进行简化: void query_planner(PlannerInfo *root, List *tli ...

  5. PostgreSQL在何处处理 sql查询之四十六

    接前面,再上溯:set_base_rel_pathlists --> set_rel_pathlist /** set_base_rel_pathlists* Finds all paths a ...

  6. PostgreSQL在何处处理 sql查询之三十九

    接前面,这次重点分析 ExecScan: 其for 循环内部: for (;;){ TupleTableSlot *slot;CHECK_FOR_INTERRUPTS(); slot = ExecSc ...

  7. PostgreSQL在何处处理 sql查询之三十八

    这里又遇到了函数指针: executor.h头文件中,定义了 ExecScanAccessMtd 指针,或者定义了一个ExecScanAccessMtd 函数原型的指针 /** prototypes ...

  8. PostgreSQL在何处处理 sql查询之六

    前面说过 PortalStart明确执行策略后,要执行 ExecutorStart. 那么ExecutorStart 到底作了什么呢.以下是缩略: /* ----------------------- ...

  9. SAP UI5 应用开发教程之六十二 - 基于 OData V4 的 SAP UI5 表格控件使用方法介绍试读版

    一套适合 SAP UI5 初学者循序渐进的学习教程 教程目录 SAP UI5 本地开发环境的搭建 SAP UI5 应用开发教程之一:Hello World SAP UI5 应用开发教程之二:SAP U ...

最新文章

  1. 使用OpenRowSet操作Excel Excel导入数据库
  2. Rust 数据类型介绍
  3. [转]MySQL实现分页查询
  4. CLR via C# 读书笔记 1-2 创建线程的成本
  5. java基础(十) 深入理解数组类型
  6. kinect 录制彩色和深度视频
  7. python gui编程框架_工程师必知的几个Python GUI框架
  8. Activity、BroadcastReceiver、Service共同工作的简单例子
  9. python 结尾回车_理解不了Python正则表达式?我帮你搞定
  10. php 5.6 文档,文件存储 | 进阶系列 | Laravel 5.6 中文文档
  11. microsoft query sql引用单元格_Microsoft.Office.Interop.Excel操作Excel拾遗
  12. Linux 查找进程与结束进程
  13. Linux netstat 命令详解
  14. python基础:os模块
  15. 佳能Canon imageCLASS MF227dw 打印机驱动
  16. 卷积神经网络通俗易懂理解
  17. 什么牌子真无线蓝牙耳机适合运动,高续航舒适小巧这五款蓝牙耳机不要错过
  18. OMV搭建系列教程[5] – 安装Aria2
  19. 无理数的无理数次幂的结果可以是有理数?(以〖√2〗^√2为例)
  20. RuntimeError: Sizes of tensors must match except in dimension 1. Got 61 and 60 in dimension 2

热门文章

  1. Sigar - no sigar-amd64-winnt.dll in java.library.path
  2. IDEA上传本地项目到SVN
  3. Java之注解的定义及使用
  4. SpringBoot(十四)_springboot使用内置定时任务Scheduled的使用(一)
  5. node.js中的文件系统
  6. ASA下邮件发送经常失败
  7. 调整数组顺序使奇数位于偶数前
  8. float 为什么可以表示很大的整数
  9. 追捕美国头号电脑通缉犯
  10. 哟西,CLOUDSTACK第一步,搞定