同一plan节点的targetlist和qual中是对同一var的指针吗?
生活随笔
收集整理的這篇文章主要介紹了
同一plan节点的targetlist和qual中是对同一var的指针吗?
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
文章目錄
- 同一plan節點的targetlist和qual中是對同一var的指針嗎?
同一plan節點的targetlist和qual中是對同一var的指針嗎?
-
select test3.id1 from test3 where test3.id1>1;
-
先在create_seqplan
在extract_actual_clauses之后,scan_clauses里面的節點發生了變化哈哈哈哈!!
/** Returns a seqscan plan for the base relation scanned by 'best_path'* with restriction clauses 'scan_clauses' and targetlist 'tlist'.*/ static SeqScan * create_seqscan_plan(PlannerInfo *root, Path *best_path,List *tlist, List *scan_clauses) {SeqScan *scan_plan;Index scan_relid = best_path->parent->relid;//(gdb) print scan_relid//$1 = 1/* it should be a base rel... */Assert(scan_relid > 0);Assert(best_path->parent->rtekind == RTE_RELATION);//(gdb) print ((Node *)(list_head(scan_clauses)->data.ptr_value))->type //$3 = T_RestrictInfo //$5 = {type = T_RestrictInfo, clause = 0x15568f8, is_pushed_down = true, // outerjoin_delayed = false, can_join = false, pseudoconstant = false, // leakproof = false, security_level = 0, clause_relids = 0x1556e80, // required_relids = 0x1556e50, outer_relids = 0x0, nullable_relids = 0x0, // left_relids = 0x1556e68, right_relids = 0x0, orclause = 0x0, // parent_ec = 0x0, eval_cost = {startup = 0, // per_tuple = 0.0025000000000000001}, norm_selec = 0.33333333333333331, outer_selec = -1, mergeopfamilies = 0x0, left_ec = 0x0, right_ec = 0x0, // left_em = 0x0, right_em = 0x0, scansel_cache = 0x0, outer_is_left = false, // hashjoinoperator = 0, left_bucketsize = -1, right_bucketsize = -1, // left_mcvfreq = -1, right_mcvfreq = -1}/* Sort clauses into best execution order */scan_clauses = order_qual_clauses(root, scan_clauses);$7 = { type = T_RestrictInfo, clause = 0x15568f8, is_pushed_down = true, outerjoin_delayed = false, can_join = false, pseudoconstant = false, leakproof = false, security_level = 0, clause_relids = 0x1556e80, required_relids = 0x1556e50, outer_relids = 0x0, nullable_relids = 0x0, left_relids = 0x1556e68, right_relids = 0x0, orclause = 0x0, parent_ec = 0x0, eval_cost = {startup = 0, per_tuple = 0.0025000000000000001}, norm_selec = 0.33333333333333331, outer_selec = -1, mergeopfamilies = 0x0, left_ec = 0x0, right_ec = 0x0, left_em = 0x0, right_em = 0x0, scansel_cache = 0x0, outer_is_left = false, hashjoinoperator = 0, left_bucketsize = -1, right_bucketsize = -1, left_mcvfreq = -1, right_mcvfreq = -1}(gdb) print &$5 $20 = (RestrictInfo *) 0x14978c0 (gdb) print &$7 $21 = (RestrictInfo *) 0x14978c0 (gdb) /* Reduce RestrictInfo list to bare expressions; ignore pseudoconstants */scan_clauses = extract_actual_clauses(scan_clauses, false);(gdb) print ((Node *)(list_head(scan_clauses)->data.ptr_value))->type $9 = T_OpExpr (gdb) print *((OpExpr *)(list_head(scan_clauses)->data.ptr_value)) $10 = {xpr = {type = T_OpExpr}, opno = 521, opfuncid = 147, opresulttype = 16, opretset = false, opcollid = 0, inputcollid = 0, args = 0x1498778, location = 43} (gdb) print *((Var *)(list_head($10.args)->data.ptr_value)) $12 = {xpr = {type = T_Var}, varno = 1, varattno = 1, vartype = 23, vartypmod = -1, varcollid = 0, varlevelsup = 0, varnoold = 1, varoattno = 1, location = 34} (gdb) (gdb) print &$12 $13 = (Var *) 0x1498708(gdb) print ((Node *)(list_head(tlist)->data.ptr_value))->type $15 = T_TargetEntry(gdb) $16 = {xpr = {type = T_TargetEntry}, expr = 0x1556d68, resno = 1, resname = 0x0, ressortgroupref = 0, resorigtbl = 0, resorigcol = 0, resjunk = false} (gdb) print ((Node *)($16.expr))->type $17 = T_Var(gdb) print *((Var *)($16.expr)) $18 = {xpr = {type = T_Var}, varno = 1, varattno = 1, vartype = 23, vartypmod = -1, varcollid = 0, varlevelsup = 0, varnoold = 1, varoattno = 1, location = 7} (gdb) print &$18 $19 = (Var *) 0x1556d68 //事實表明不一樣啊!!!!!!!!!!,很顯然location都不一樣/* Replace any outer-relation variables with nestloop params */if (best_path->param_info){scan_clauses = (List *)replace_nestloop_params(root, (Node *) scan_clauses);}scan_plan = make_seqscan(tlist,scan_clauses,scan_relid);copy_generic_path_info(&scan_plan->plan, best_path);return scan_plan; }總結
以上是生活随笔為你收集整理的同一plan节点的targetlist和qual中是对同一var的指针吗?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: App短流行
- 下一篇: 属性python_Python属性描述符