![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pgsql9.6.1源码
fgh431
非淡泊无以明志
展开
-
postgresql-9.6.1\src\include\access\tupdesc.h中的tupleDesc结构体解读
标题上已经写出了这个结构体tupleDesc描述所在的头文件。 注释既有英文也有翻译。 这个结构体是用来描述元组的结构的。 对于那些来自磁盘上的关系表,这个信息从pg_attribute,pg_attrdef,pg_constraint目录下收集。 下面这句话还是不翻译了:Transient row types (such as the result of a join query) have a...原创 2019-05-19 11:15:16 · 679 阅读 · 0 评论 -
postgresql-9.6.1\src\include\nodes\execnodes.h的ExprDoneCond枚举类型
它是Set-result status returned by ExecEvalExpr() typedef enum { ExprSingleResult, /* expression does not return a set */ /*表达式不返回一个集合*/ ExprMultipleResult, /* this result is ...原创 2019-06-01 09:20:36 · 169 阅读 · 0 评论 -
postgresql-9.6.1\src\include\nodes\primnodes.h里的Const结构体
typedef struct Const { Expr xpr; Oid consttype; /* pg_type OID of the constant's datatype */ int32 consttypmod; /* typmod value, if any */ Oid co...原创 2019-06-01 09:01:08 · 202 阅读 · 0 评论 -
postgresql-9.6.1\src\backend\executor\execQual.c里面的Exec函数
这篇博客说过了ExprStateEvalFunc这个自定义的数据类型 这个类型的变量可以指向哪些函数呢? 没错,他可以指向我们今天介绍的函数! \ \ \ \ \ 我们以这个为例来看一下这个函数的源代码 static Datum ExecEvalConst( ExprState *exprstate, ExprContext *econtext, bool *i...原创 2019-06-01 08:52:16 · 357 阅读 · 0 评论 -
postgresql-9.6.1\src\include\utils\palloc.h里的MemoryContext指针
MemoryContext实际上是一个指针; typedef struct MemoryContextData *MemoryContext 可是MemoryContextData却是在 postgresql-9.6.1\src\include\nodes\memnodes.h 里面声明的。 \ \ \ \ \ 我们来看看这个结构体长什么样子 typedef struct MemoryContex...翻译 2019-05-31 14:57:25 · 240 阅读 · 0 评论 -
postgresql-9.6.1\src\include\nodes\primnodes.h里的Var结构体
Var-expression node representing a variable (ie, a table column) during parsing/planning, varnoold/varoattno are always just copies of varno/varattno typedef struct Var { Expr xpr; ...原创 2019-05-31 14:29:29 · 257 阅读 · 0 评论 -
postgresql-9.6.1\src\include\nodes\primnodes.h里的Expr结构体
所有表达式结点的第一个域都是Expr expr; 例如Var结构体啦,Const结构体啦 typedef struct Expr{ NodeTag type; } Expr;原创 2019-05-31 14:10:27 · 215 阅读 · 0 评论 -
postgresql-9.6.1\src\include\nodes\execnodes.h中的ExprState结构体
表达式状态结构体(ExprState)居然只有三个变量。 typedef struct ExprState ExprState; typedef Datum (*ExprStateEvalFunc) (ExprState *expression, ExprContext *econtext, ...原创 2019-06-01 08:29:57 · 272 阅读 · 0 评论 -
postgresql-9.6.1\src\include\catalog\pg_attribute.h里面的Form_pg_attribute指针
Form_pg_attribute实际上是一个指针 typedef FormData_pg_attribute *Form_pg_attribute; 所以我们需要看一下FormData_pg_attribute结构体。原创 2019-05-31 12:24:17 · 393 阅读 · 0 评论 -
postgresql-9.6.1\src\backend\executor\nodeNestloop.c里面写的joinqual
我们主要想通过joinqual这个结构体指针来找到连接条件, 比如:是两个表的那几列,是大于等于还是其他的呢?\ \ \ \ \ \ 他是这样声明和赋值的 List *joinqual; NestLoopState *node//这个是函数的参数哦! joinqual = node->js.joinqual; \ \ \ \ \ List结构体是这样的 typedef struc...原创 2019-05-31 11:46:37 · 294 阅读 · 0 评论 -
postgresql-9.6.1\src\include\snowball\header.h的几行代码
#define malloc(a) palloc(a) /*分配a字节连续空间*/ #define calloc(a,b) palloc0((a) * (b))/*分配a个,每个大小为b字节的区域*/ #define realloc(a,b) repalloc(a,b) /*a是本来分配好的首地址,b是新的数组的长度*/ #define free(a...原创 2019-05-17 22:00:41 · 218 阅读 · 0 评论 -
postgresql-9.6.1\src\include\executor\tuptable.h中的TupleTableSlot结构体
执行器通过使用一个元组表来存储元组,这个元组表是一个独立的TupleTableSlots构成的链表。有以下四种情形我们需要处理: 存储在磁盘缓冲页上的物理元组 那些在palloc’ed内存上构建的物理元组 那些在palloc’ed内存上构建的精简的物理元组 那些由Datum和isnull数组组成的虚拟元组 前两个情形是相似的,因为它们面对的都是物化的元组,但是resource manageme...原创 2019-05-17 23:52:28 · 748 阅读 · 2 评论 -
postgresql-9.6.1\src\backend\executor\execQual.c里的ExecProject函数
TupleTableSlot * ExecProject(ProjectionInfo *projInfo, ExprDoneCond *isDone) projects a tuple based on projection info and stores it in the previously specified tuple table slot. the result is alw...原创 2019-06-01 09:55:07 · 348 阅读 · 0 评论