这篇文章主要为大家展示了“PostgreSQL中PlannedStmt的跟踪分析”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“PostgreSQL中PlannedStmt的跟踪分析”这篇文章吧。
计划树
二、数据结构
Plan
typedef struct Plan
{
NodeTag type;
Cost startup_cost;
Cost total_cost;
double plan_rows;
int plan_width;
bool parallel_aware;
bool parallel_safe;
int plan_node_id;
List *targetlist;
List *qual;
struct Plan *lefttree;
struct Plan *righttree;
List *initPlan;
Bitmapset *extParam;
Bitmapset *allParam;
} Plan;
Limit
typedef struct Limit
{
Plan plan;
Node *limitOffset;
Node *limitCount;
} Limit;
Sort
typedef struct Sort
{
Plan plan;
int numCols;
AttrNumber *sortColIdx;
Oid *sortOperators;
Oid *collations;
bool *nullsFirst;
} Sort;
Append
typedef struct Append
{
Plan plan;
List *appendplans;
int first_partial_plan;
List *partitioned_rels;
struct PartitionPruneInfo *part_prune_info;
} Append;
NestLoop
typedef struct NestLoop
{
Join join;
List *nestParams;
} NestLoop;
typedef struct NestLoopParam
{
NodeTag type;
int paramno;
Var *paramval;
} NestLoopParam;
typedef struct MergeJoin
{
Join join;
bool skip_mark_restore;
List *mergeclauses;
Oid *mergeFamilies;
Oid *mergeCollations;
int *mergeStrategies;
bool *mergeNullsFirst;
} MergeJoin;
typedef struct HashJoin
{
Join join;
List *hashclauses;
} HashJoin;
typedef struct Join
{
Plan plan;
JoinType jointype;
bool inner_unique;
List *joinqual;
} Join;
SeqScan
typedef struct Scan
{
Plan plan;
Index scanrelid;
} Scan;
typedef Scan SeqScan;
以上是“PostgreSQL中PlannedStmt的跟踪分析”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!