博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PostgreSQL在何处处理 sql查询之六十二
阅读量:4678 次
发布时间:2019-06-09

本文共 1833 字,大约阅读时间需要 6 分钟。

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

你可能感兴趣的文章
node启动时, listen EADDRINUSE 报错;
查看>>
vue学习链接
查看>>
Systemd 初始化进程
查看>>
【C#学习笔记】文本复制到粘贴板
查看>>
Windows store 验证你的 URL http:// 和 https:// ms-appx:/// ms-appdata:///local
查看>>
python全栈开发_day7_字符编码,以及文件的基本读取
查看>>
js 验证码 倒计时60秒
查看>>
C#基础
查看>>
ASP.NET Core MVC 2.x 全面教程_ASP.NET Core MVC 15. 用户管理
查看>>
杭电3466————DP之01背包(对状态转移方程的更新理解)
查看>>
JSP页面中的精确到秒的时间控件
查看>>
C#4.0语言新功能及应用 (1)
查看>>
http协议状态码对照表
查看>>
xmapp中 使用admin的权限打开mysql时出现错误1045
查看>>
chrome表单自动填充去掉input黄色背景
查看>>
使用hex6x 进行十六进制转换
查看>>
第一章 用标准I/O函数将标准输入复制到标准输出 1-3
查看>>
Remove Mapping
查看>>
NSLog打印信息的从新设置
查看>>
关于TCP/IP与数据传输
查看>>