Postgresql源码(113)表达式JIT计算简单分析

news2024/12/29 9:51:59

相关
《Postgresql源码(85)查询执行——表达式解析器分析(select 1+1如何执行)》
《Postgresql源码(113)表达式JIT计算简单分析》

1 普通表达式计算

普通表达式计算发生在优化器preprocess_expression中,会先把能算出来的函数都计算一遍,把值添加到plan中。

#0  ExecInterpExpr (state=0x16188b8, econtext=0x1618df8, isnull=0x7ffcbbb1b6af) at execExprInterp.c:508
#1  0x000000000072b06f in ExecInterpExprStillValid (state=0x16188b8, econtext=0x1618df8, isNull=0x7ffcbbb1b6af) at execExprInterp.c:1870
#2  0x00000000008abc53 in ExecEvalExprSwitchContext (state=0x16188b8, econtext=0x1618df8, isNull=0x7ffcbbb1b6af) at ../../../../src/include/executor/executor.h:355
#3  0x00000000008b33d5 in evaluate_expr (expr=0x15524d8, result_type=23, result_typmod=-1, result_collation=0) at clauses.c:4902
#4  0x00000000008b26f8 in evaluate_function (funcid=177, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args=0x1552438, funcvariadic=false,
    func_tuple=0x7f8ed3ebc3f8, context=0x7ffcbbb1ccb0) at clauses.c:4409
#5  0x00000000008b1a47 in simplify_function (funcid=177, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args_p=0x7ffcbbb1b8c8, funcvariadic=false,
    process_args=true, allow_non_const=true, context=0x7ffcbbb1ccb0) at clauses.c:3997
#6  0x00000000008af028 in eval_const_expressions_mutator (node=0x1521488, context=0x7ffcbbb1ccb0) at clauses.c:2551
#7  0x00000000007e7ed9 in expression_tree_mutator_impl (node=0x15214d8, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffcbbb1ccb0) at nodeFuncs.c:3298
#8  0x00000000008b13ec in eval_const_expressions_mutator (node=0x15214d8, context=0x7ffcbbb1ccb0) at clauses.c:3616
#9  0x00000000007e82e4 in expression_tree_mutator_impl (node=0x1521528, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffcbbb1ccb0) at nodeFuncs.c:3384
#10 0x00000000008b13ec in eval_const_expressions_mutator (node=0x1521528, context=0x7ffcbbb1ccb0) at clauses.c:3616
#11 0x00000000008ae720 in eval_const_expressions (root=0x1521648, node=0x1521528) at clauses.c:2183
#12 0x0000000000885d2a in preprocess_expression (root=0x1521648, expr=0x1521528, kind=1) at planner.c:1144
#13 0x0000000000885173 in subquery_planner (glob=0x1520e08, parse=0x1520f18, parent_root=0x0, hasRecursion=false, tuple_fraction=0) at planner.c:811
#14 0x0000000000884293 in standard_planner (parse=0x1520f18, query_string=0x151fe78 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at planner.c:413
#15 0x000000000088403a in planner (parse=0x1520f18, query_string=0x151fe78 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at planner.c:281
#16 0x00000000009b5ec0 in pg_plan_query (querytree=0x1520f18, query_string=0x151fe78 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at postgres.c:904
#17 0x00000000009b600c in pg_plan_queries (querytrees=0x15215f8, query_string=0x151fe78 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at postgres.c:996
#18 0x00000000009b638c in exec_simple_query (query_string=0x151fe78 "select 1000+abs(-10000)+100;") at postgres.c:1193
#19 0x00000000009bab95 in PostgresMain (dbname=0x15572f8 "postgres", username=0x151bad8 "mingjie") at postgres.c:4637
#20 0x00000000008f1d6d in BackendRun (port=0x154db80) at postmaster.c:4464
#21 0x00000000008f1706 in BackendStartup (port=0x154db80) at postmaster.c:4192
#22 0x00000000008edfd1 in ServerLoop () at postmaster.c:1782
#23 0x00000000008ed9a1 in PostmasterMain (argc=1, argv=0x1519a80) at postmaster.c:1466
#24 0x00000000007b8201 in main (argc=1, argv=0x1519a80) at main.c:198

1.1 计算select 1000+abs(-10000)+100;

select 1000+abs(-10000)+100;

Query Tree
在这里插入图片描述
优化器处理:ExecInterpExpr过程
在这里插入图片描述

1.1.1 第一步计算abs(-10000)

ExecInterpExpr

(gdb) p	*state
$6 = {type = T_ExprState, 
  flags = 6 '\006', 
  resnull = false, resvalue = 0, resultslot = 0x0, 
  steps = 0x16189e8,
  evalfunc = 0x7288a3 <ExecInterpExpr>, 
  expr = 0x15522f8,                                 → 指向上面FuncExpr
  evalfunc_private = 0x7288a3 <ExecInterpExpr>,	
  steps_len = 2, 
  steps_alloc = 16, 
  parent = 0x0, 
  ext_params = 0x0, 
  innermost_caseval = 0x0, 
  innermost_casenull = 0x0,
  innermost_domainval =	0x0, 
  innermost_domainnull = 0x0}

先看第0步,跳转到哪
第一步:EEOP_FUNCEXPR_STRICT
第二步:EEOP_DONE

(gdb) p/x state->steps[0]->opcode
$23 = 0x72914f
(gdb) p/x state->steps[1]->opcode
$30 = 0x72893a

(gdb) p reverse_dispatch_table
$24 = {
...
{opcode = 0x72893a <ExecInterpExpr+151>, op = EEOP_DONE},
{opcode = 0x72914f <ExecInterpExpr+2220>, op = EEOP_FUNCEXPR_STRICT}
...
}

当前分支所需数据

(gdb) p state->steps[0]->d.func
$14 = {finfo = 0x1618948, fcinfo_data = 0x1618998, fn_addr = 0xa51c5d <int4abs>, nargs = 1}

进入分支干活,计算abs(-10000)结果

		EEO_CASE(EEOP_FUNCEXPR_STRICT)
		{
			FunctionCallInfo fcinfo = op->d.func.fcinfo_data;
			NullableDatum *args = fcinfo->args;
			int			nargs = op->d.func.nargs;
			Datum		d;

			/* strict function, so check for NULL args */
			for (int argno = 0; argno < nargs; argno++)
			{
				if (args[argno].isnull)
				{
					*op->resnull = true;
					goto strictfail;
				}
			}
			fcinfo->isnull = false;
			d = op->d.func.fn_addr(fcinfo);  // 用函数地址调用函数拿到结果
			*op->resvalue = d;
			*op->resnull = fcinfo->isnull;

	strictfail:
			EEO_NEXT();
		}

(下面内存可参考《Postgresql源码(85)查询执行——表达式解析器分析(select 1+1如何执行)》)
在回忆一下表达式计算ExecInterpExpr函数的过程,核心就是这个op也就是step,这个ExprEvalStep结构体在执行ExecInterpExpr时作为核心结构体中的数据传入,具体在ExprState→steps中保存,这是一个数据,每一个元素代表一次计算,由ExprEvalStep结构记录当前计算的内存:

在这里插入图片描述

1.1.2 第二步计算1000+10000

同上,注意上面第一步和现在的steps_len都是2,也就是都做一次计算。

就是说每次计算都是由eval_const_expressions_mutator遍历树时,发现function节点后,发生的。

(gdb) p *state
$31 = {type = T_ExprState, 
  flags = 6 '\006', 
  resnull = false, 
  resvalue = 0, 
  resultslot = 0x0, 
  steps = 0x16189e8, 
  evalfunc = 0x7288a3 <ExecInterpExpr>, 
  expr = 0x1552398,                 // FuncExpr->args = {Const{1000}, Const{10000}}
  evalfunc_private = 0x7288a3 <ExecInterpExpr>, 
  steps_len = 2, 
  steps_alloc = 16, 
  parent = 0x0, 
  ext_params = 0x0, 
  innermost_caseval = 0x0, 
  innermost_casenull = 0x0,
  innermost_domainval = 0x0, 
  innermost_domainnull = 0x0}

1.1.3 第三步计算11000+100

同上

2 JIT表达式计算

2.1 计算select 1000+abs(-10000)+100;

第一次进入jit堆栈jit_compile_expr,state→expr = (FuncExpr)表示abs(-10000)

因为不是parent表达式,不再继续计算

#0  jit_compile_expr (state=0x1deae18) at jit.c:180
#1  0x000000000071fa6b in ExecReadyExpr (state=0x1deae18) at execExpr.c:874
#2  0x000000000071e60b in ExecInitExpr (node=0x1dfabb8, parent=0x0) at execExpr.c:152
#3  0x00000000008b3395 in evaluate_expr (expr=0x1dfabb8, result_type=23, result_typmod=-1, result_collation=0) at clauses.c:4892
#4  0x00000000008b26f8 in evaluate_function (funcid=1397, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args=0x1dfab68, funcvariadic=false, func_tuple=0x7fd9588871a8, context=0x7ffdd8867f20) at clauses.c:4409
#5  0x00000000008b1a47 in simplify_function (funcid=1397, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args_p=0x7ffdd8865960, funcvariadic=false, process_args=true, allow_non_const=true, context=0x7ffdd8867f20) at clauses.c:3997
#6  0x00000000008aee93 in eval_const_expressions_mutator (node=0x1cf92e8, context=0x7ffdd8867f20) at clauses.c:2503
#7  0x00000000007e82e4 in expression_tree_mutator_impl (node=0x1cf9338, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffdd8867f20) at nodeFuncs.c:3384
#8  0x00000000008b1a05 in simplify_function (funcid=177, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args_p=0x7ffdd8866248, funcvariadic=false, process_args=true, allow_non_const=true, context=0x7ffdd8867f20) at clauses.c:3988
#9  0x00000000008af028 in eval_const_expressions_mutator (node=0x1cf9388, context=0x7ffdd8867f20) at clauses.c:2551
#10 0x00000000007e82e4 in expression_tree_mutator_impl (node=0x1cf9428, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffdd8867f20) at nodeFuncs.c:3384
#11 0x00000000008b1a05 in simplify_function (funcid=177, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args_p=0x7ffdd8866b38, funcvariadic=false, process_args=true, allow_non_const=true, context=0x7ffdd8867f20) at clauses.c:3988
#12 0x00000000008af028 in eval_const_expressions_mutator (node=0x1cf9478, context=0x7ffdd8867f20) at clauses.c:2551
#13 0x00000000007e7ed9 in expression_tree_mutator_impl (node=0x1cf94c8, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffdd8867f20) at nodeFuncs.c:3298
#14 0x00000000008b13ec in eval_const_expressions_mutator (node=0x1cf94c8, context=0x7ffdd8867f20) at clauses.c:3616
#15 0x00000000007e82e4 in expression_tree_mutator_impl (node=0x1cf9518, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffdd8867f20) at nodeFuncs.c:3384
#16 0x00000000008b13ec in eval_const_expressions_mutator (node=0x1cf9518, context=0x7ffdd8867f20) at clauses.c:3616
#17 0x00000000008ae720 in eval_const_expressions (root=0x1cf9638, node=0x1cf9518) at clauses.c:2183
#18 0x0000000000885d2a in preprocess_expression (root=0x1cf9638, expr=0x1cf9518, kind=1) at planner.c:1144
#19 0x0000000000885173 in subquery_planner (glob=0x1cf8df8, parse=0x1cf8f08, parent_root=0x0, hasRecursion=false, tuple_fraction=0) at planner.c:811
#20 0x0000000000884293 in standard_planner (parse=0x1cf8f08, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at planner.c:413
#21 0x000000000088403a in planner (parse=0x1cf8f08, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at planner.c:281
#22 0x00000000009b5ec0 in pg_plan_query (querytree=0x1cf8f08, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at postgres.c:904
#23 0x00000000009b600c in pg_plan_queries (querytrees=0x1cf95e8, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at postgres.c:996
#24 0x00000000009b638c in exec_simple_query (query_string=0x1cf7e68 "select 1000+abs(-10000)+100;") at postgres.c:1193
#25 0x00000000009bab95 in PostgresMain (dbname=0x1d2f2e8 "postgres", username=0x1cf3ac8 "mingjie") at postgres.c:4637
#26 0x00000000008f1d6d in BackendRun (port=0x1d25b70) at postmaster.c:4464
#27 0x00000000008f1706 in BackendStartup (port=0x1d25b70) at postmaster.c:4192
#28 0x00000000008edfd1 in ServerLoop () at postmaster.c:1782
#29 0x00000000008ed9a1 in PostmasterMain (argc=1, argv=0x1cf1a70) at postmaster.c:1466
#30 0x00000000007b8201 in main (argc=1, argv=0x1cf1a70) at main.c:198
第二次进入jit堆栈jit_compile_expr,state→expr = (FuncExpr)表示1000+10000

因为不是parent表达式,不再继续计算。

#0  jit_compile_expr (state=0x1deae18) at jit.c:165
#1  0x000000000071fa6b in ExecReadyExpr (state=0x1deae18) at execExpr.c:874
#2  0x000000000071e60b in ExecInitExpr (node=0x1dfac58, parent=0x0) at execExpr.c:152
#3  0x00000000008b3395 in evaluate_expr (expr=0x1dfac58, result_type=23, result_typmod=-1, result_collation=0) at clauses.c:4892
#4  0x00000000008b26f8 in evaluate_function (funcid=177, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args=0x1dfaac8, funcvariadic=false, func_tuple=0x7fd9588876b8, context=0x7ffdd8867f20) at clauses.c:4409
#5  0x00000000008b1a47 in simplify_function (funcid=177, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args_p=0x7ffdd8866248, funcvariadic=false, process_args=true, allow_non_const=true, context=0x7ffdd8867f20) at clauses.c:3997
#6  0x00000000008af028 in eval_const_expressions_mutator (node=0x1cf9388, context=0x7ffdd8867f20) at clauses.c:2551
#7  0x00000000007e82e4 in expression_tree_mutator_impl (node=0x1cf9428, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffdd8867f20) at nodeFuncs.c:3384
#8  0x00000000008b1a05 in simplify_function (funcid=177, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args_p=0x7ffdd8866b38, funcvariadic=false, process_args=true, allow_non_const=true, context=0x7ffdd8867f20) at clauses.c:3988
#9  0x00000000008af028 in eval_const_expressions_mutator (node=0x1cf9478, context=0x7ffdd8867f20) at clauses.c:2551
#10 0x00000000007e7ed9 in expression_tree_mutator_impl (node=0x1cf94c8, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffdd8867f20) at nodeFuncs.c:3298
#11 0x00000000008b13ec in eval_const_expressions_mutator (node=0x1cf94c8, context=0x7ffdd8867f20) at clauses.c:3616
#12 0x00000000007e82e4 in expression_tree_mutator_impl (node=0x1cf9518, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffdd8867f20) at nodeFuncs.c:3384
#13 0x00000000008b13ec in eval_const_expressions_mutator (node=0x1cf9518, context=0x7ffdd8867f20) at clauses.c:3616
#14 0x00000000008ae720 in eval_const_expressions (root=0x1cf9638, node=0x1cf9518) at clauses.c:2183
#15 0x0000000000885d2a in preprocess_expression (root=0x1cf9638, expr=0x1cf9518, kind=1) at planner.c:1144
#16 0x0000000000885173 in subquery_planner (glob=0x1cf8df8, parse=0x1cf8f08, parent_root=0x0, hasRecursion=false, tuple_fraction=0) at planner.c:811
#17 0x0000000000884293 in standard_planner (parse=0x1cf8f08, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at planner.c:413
#18 0x000000000088403a in planner (parse=0x1cf8f08, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at planner.c:281
#19 0x00000000009b5ec0 in pg_plan_query (querytree=0x1cf8f08, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at postgres.c:904
#20 0x00000000009b600c in pg_plan_queries (querytrees=0x1cf95e8, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at postgres.c:996
#21 0x00000000009b638c in exec_simple_query (query_string=0x1cf7e68 "select 1000+abs(-10000)+100;") at postgres.c:1193
#22 0x00000000009bab95 in PostgresMain (dbname=0x1d2f2e8 "postgres", username=0x1cf3ac8 "mingjie") at postgres.c:4637
#23 0x00000000008f1d6d in BackendRun (port=0x1d25b70) at postmaster.c:4464
#24 0x00000000008f1706 in BackendStartup (port=0x1d25b70) at postmaster.c:4192
#25 0x00000000008edfd1 in ServerLoop () at postmaster.c:1782
#26 0x00000000008ed9a1 in PostmasterMain (argc=1, argv=0x1cf1a70) at postmaster.c:1466
#27 0x00000000007b8201 in main (argc=1, argv=0x1cf1a70) at main.c:198
第三次进入jit堆栈jit_compile_expr,state→expr = (FuncExpr)表示11000+100

因为不是parent表达式,不再继续计算。

#0  jit_compile_expr (state=0x1deae18) at jit.c:165
#1  0x000000000071fa6b in ExecReadyExpr (state=0x1deae18) at execExpr.c:874
#2  0x000000000071e60b in ExecInitExpr (node=0x1dfad98, parent=0x0) at execExpr.c:152
#3  0x00000000008b3395 in evaluate_expr (expr=0x1dfad98, result_type=23, result_typmod=-1, result_collation=0) at clauses.c:4892
#4  0x00000000008b26f8 in evaluate_function (funcid=177, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args=0x1dfacf8, funcvariadic=false, func_tuple=0x7fd9588876b8, context=0x7ffdd8867f20) at clauses.c:4409
#5  0x00000000008b1a47 in simplify_function (funcid=177, result_type=23, result_typmod=-1, result_collid=0, input_collid=0, args_p=0x7ffdd8866b38, funcvariadic=false, process_args=true, allow_non_const=true, context=0x7ffdd8867f20) at clauses.c:3997
#6  0x00000000008af028 in eval_const_expressions_mutator (node=0x1cf9478, context=0x7ffdd8867f20) at clauses.c:2551
#7  0x00000000007e7ed9 in expression_tree_mutator_impl (node=0x1cf94c8, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffdd8867f20) at nodeFuncs.c:3298
#8  0x00000000008b13ec in eval_const_expressions_mutator (node=0x1cf94c8, context=0x7ffdd8867f20) at clauses.c:3616
#9  0x00000000007e82e4 in expression_tree_mutator_impl (node=0x1cf9518, mutator=0x8ae95b <eval_const_expressions_mutator>, context=0x7ffdd8867f20) at nodeFuncs.c:3384
#10 0x00000000008b13ec in eval_const_expressions_mutator (node=0x1cf9518, context=0x7ffdd8867f20) at clauses.c:3616
#11 0x00000000008ae720 in eval_const_expressions (root=0x1cf9638, node=0x1cf9518) at clauses.c:2183
#12 0x0000000000885d2a in preprocess_expression (root=0x1cf9638, expr=0x1cf9518, kind=1) at planner.c:1144
#13 0x0000000000885173 in subquery_planner (glob=0x1cf8df8, parse=0x1cf8f08, parent_root=0x0, hasRecursion=false, tuple_fraction=0) at planner.c:811
#14 0x0000000000884293 in standard_planner (parse=0x1cf8f08, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at planner.c:413
#15 0x000000000088403a in planner (parse=0x1cf8f08, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at planner.c:281
#16 0x00000000009b5ec0 in pg_plan_query (querytree=0x1cf8f08, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at postgres.c:904
#17 0x00000000009b600c in pg_plan_queries (querytrees=0x1cf95e8, query_string=0x1cf7e68 "select 1000+abs(-10000)+100;", cursorOptions=2048, boundParams=0x0) at postgres.c:996
#18 0x00000000009b638c in exec_simple_query (query_string=0x1cf7e68 "select 1000+abs(-10000)+100;") at postgres.c:1193
#19 0x00000000009bab95 in PostgresMain (dbname=0x1d2f2e8 "postgres", username=0x1cf3ac8 "mingjie") at postgres.c:4637
#20 0x00000000008f1d6d in BackendRun (port=0x1d25b70) at postmaster.c:4464
#21 0x00000000008f1706 in BackendStartup (port=0x1d25b70) at postmaster.c:4192
#22 0x00000000008edfd1 in ServerLoop () at postmaster.c:1782
#23 0x00000000008ed9a1 in PostmasterMain (argc=1, argv=0x1cf1a70) at postmaster.c:1466
#24 0x00000000007b8201 in main (argc=1, argv=0x1cf1a70) at main.c:198
第四次进入jit堆栈jit_compile_expr,state→expr = (List)记录TargetEntry

TargetEntry的expr记录结果11100

{ xpr = {type = T_TargetEntry}, 
  expr = Const{constvalue = 11100} ,
  resno = 1, 
  resname = 0xcbfb88 "?column?", 
  ressortgroupref = 0, 
  resorigtbl = 0, 
  resorigcol = 0, 
  resjunk = false}

进入jit_compile_expr→llvm_compile_expr开始编译表达式

#0  llvm_compile_expr (state=0x1deb218) at llvmjit_expr.c:80
#1  0x0000000000bd3698 in jit_compile_expr (state=0x1deb218) at jit.c:177
#2  0x000000000071fa6b in ExecReadyExpr (state=0x1deb218) at execExpr.c:874
#3  0x000000000071eecb in ExecBuildProjectionInfo (targetList=0x1dfb890, econtext=0x1deaf40, slot=0x1deb130, parent=0x1deae30, inputDesc=0x0) at execExpr.c:479
#4  0x0000000000749d1b in ExecAssignProjectionInfo (planstate=0x1deae30, inputDesc=0x0) at execUtils.c:547
#5  0x00000000007827d0 in ExecInitResult (node=0x1dfb7b0, estate=0x1deac08, eflags=32) at nodeResult.c:221
#6  0x00000000007403d1 in ExecInitNode (node=0x1dfb7b0, estate=0x1deac08, eflags=32) at execProcnode.c:167
#7  0x0000000000735daf in InitPlan (queryDesc=0x1d1fb98, eflags=32) at execMain.c:968
#8  0x0000000000734c85 in standard_ExecutorStart (queryDesc=0x1d1fb98, eflags=32) at execMain.c:266
#9  0x00000000007349fa in ExecutorStart (queryDesc=0x1d1fb98, eflags=0) at execMain.c:145
#10 0x00000000009bc3dc in PortalStart (portal=0x1da1368, params=0x0, eflags=0, snapshot=0x0) at pquery.c:517
#11 0x00000000009b6419 in exec_simple_query (query_string=0x1cf7e68 "select 1000+abs(-10000)+100;") at postgres.c:1235
#12 0x00000000009bab95 in PostgresMain (dbname=0x1d2f2e8 "postgres", username=0x1cf3ac8 "mingjie") at postgres.c:4637
#13 0x00000000008f1d6d in BackendRun (port=0x1d25b70) at postmaster.c:4464
#14 0x00000000008f1706 in BackendStartup (port=0x1d25b70) at postmaster.c:4192
#15 0x00000000008edfd1 in ServerLoop () at postmaster.c:1782
#16 0x00000000008ed9a1 in PostmasterMain (argc=1, argv=0x1cf1a70) at postmaster.c:1466
#17 0x00000000007b8201 in main (argc=1, argv=0x1cf1a70) at main.c:198

llvm_compile_expr函数从功能来看是严格对标ExecInterpExpr表达式计算的,例如计算函数表达式的结果EEOP_FUNCEXPR_STRICT分支:
在这里插入图片描述

4 用例

set max_parallel_workers_per_gather to 0;
set jit_expressions to on;
set jit_tuple_deforming to on;
set jit_above_cost to 0;
set jit_inline_above_cost to 0;
set jit_optimize_above_cost to 0;
explain analyze select abs(-10000)+1000+100;
select 1000+abs(-10000)+100;

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1040829.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

uni-app 使用 scss 实现推荐标签区域显示效果

效果图 <view class"tag-box"><view class"tag-tip"><view>店家</view><view>推荐</view></view> </view> 方法一 只需修改 $tagFontSize(字体大小) 即可 /* 推荐标签区域 */ .tag-box {$tagFontSize:…

uni-app:实现元素中实现竖直居中

效果展示 前&#xff1a; 后&#xff1a; 未实现前代码 <template><view class"container"><view class"centered-element">我是要被居中的元素</view></view> </template><script>export default {data() {r…

算法与数据结构-堆

文章目录 什么是堆如何实现一个堆&#xff1f;如何基于堆实现排序&#xff1f;1. 建堆2. 排序 什么是堆 堆是一种特殊的树&#xff0c;特殊点有二&#xff0c;如下&#xff1a; 堆是一个完全二叉树&#xff1b;堆中每一个节点的值都必须大于等于&#xff08;或小于等于&#…

【Vue】Mock.js介绍和使用与首页导航栏左侧菜单搭建

目录 一、Mock.js 1.1 mockjs介绍 1.2 mock.js安装与配置 1.2.1 安装mock.js 1.2.2 引入mock.js 1.3 mock.js的使用 1.3.1 准备模拟数据 1.3.2 定义拦截路由 1.3.3 测试 二、首页导航栏左侧菜单搭建 2.1 自定义界面组件 (完整代码) 2.2 配置路由 2.3 组件显示折叠和…

uniapp ui安装

安装 ui uni-app官网 (dcloud.net.cn) 安装 pages.js配置 使用 <template><view class"bg"><div class"title"><uni-data-selectv-model"value":localdata"range"change"change">asa</uni-da…

GiliSoft USB Lock v10.5.0 电脑USB设备管控软件

网盘下载 软件功能特性 禁止USB / SD驱动器 禁用从USB / SD磁盘读取&#xff0c;禁用写入USB / SD磁盘&#xff0c;阻止非系统分区。它不允许任何类型的USB / SD驱动器访问您的计算机&#xff0c;除非您授权它或它已在可信设备白名单。 CD锁&#xff0c;块媒体和蓝光光盘 禁用…

代码阅读分析神器-Scitools Understand

这里写目录标题 前言概要功能介绍1.代码统计2.图形化分析3.代码检查 使用方法下载及使用 前言 作为一名程序员&#xff0c;阅读代码是一个必须要拥有的能力&#xff0c;但无奈很多代码逻辑嵌套非常多&#xff0c;看起来非常吃力&#xff0c;看了那段逻辑就忘记了刚才的逻辑&am…

Spring实例化源码解析之ComponentScanAnnotationParser(四)

上一章我们分析了ConfigurationClassParser&#xff0c;配置类的解析源码分析。在ComponentScans和ComponentScan注解修饰的候选配置类的解析过程中&#xff0c;我们需要深入的了解一下ComponentScanAnnotationParser的parse执行流程&#xff0c;SpringBoot启动类为什么这么写&…

01 MIT线性代数-方程组的几何解释

一, 线性方程的几何图像 The geometry of linear equations 线性代数的基本问题就是解n元一次方程组 eg&#xff1a;二元一次方程组 矩阵形式: 系数矩阵(coefficient matrix): 未知数向量: 线性方程组简记为Axb 二, 行图像 Row Picture 行图像遵从解析几何的描述&#xff0…

李宏毅hw-10 ——adversarial attack

一、查漏补缺&#xff1a; 1.关于glob.glob的用法&#xff0c;返回一个文件路径的 列表&#xff1a; 当然&#xff0c;再套用1个sort&#xff0c;就是将所有的文件路径按照字母进行排序了 2.relpath relative_path返回相对于基准路径的相对路径的函数 二、代码剖析&#xff…

Pytorch之AlexNet花朵分类

&#x1f482; 个人主页:风间琉璃&#x1f91f; 版权: 本文由【风间琉璃】原创、在CSDN首发、需要转载请联系博主&#x1f4ac; 如果文章对你有帮助、欢迎关注、点赞、收藏(一键三连)和订阅专栏哦 目录 一、AlexNet 1.卷积模块 2.全连接模块 3.AlexNet创新点 1.更深的神经…

深度学习技巧应用28-强化学习的原理介绍与运用技巧实践

大家好,我是微学AI,今天给大家介绍一下深度学习技巧应用28-强化学习的原理介绍与运用技巧实践, 强化学习是一种机器学习的子领域,它使得一个智能体在与环境的交互中学习如何行动以最大化某种数值奖励信号。强化学习模型的关键特性是它的试错搜索和延迟奖励。 一、强化学习…

React 全栈体系(十四)

第七章 redux 六、react-redux 7. 代码 - react-redux 数据共享版 7.1 效果 7.2 App /* src/App.jsx */ import React, { Component } from "react"; import Count from "./containers/Count"; import Person from "./containers/Person";ex…

opencv dnn模块 示例(17) 目标检测 object_detection 之 yolo v5

在前文【opencv dnn模块 示例(16) 目标检测 object_detection 之 yolov4】介绍的yolo v4后的2个月&#xff0c;Ultralytics发布了YOLOV5 的第一个正式版本&#xff0c;其性能与YOLO V4不相伯仲。 文章目录 1、Yolo v5 和 Yolo v4 的区别说明1.1、Data Augmentation - 数据增强1…

Shader中的渲染路径LightMode

文章目录 前言一、在Shader中如何区分不同的渲染路径1、Pass Tag2、LightMode的不同类型 二、在Frame Debug下查看渲染路径之间的区别1、在摄像机可以切换渲染路径2、前向渲染路径3、延迟渲染路径4、顶点照明渲染路径&#xff08;可以看出效果很差&#xff09; 前言 Shader中的…

网络竞品分析:用爬虫技术洞悉竞争对手

概述 网络竞品分析是指通过互联网收集、分析和比较竞争对手的信息&#xff0c;以了解他们的优势和劣势&#xff0c;找出自己的差距和机会&#xff0c;制定有效的竞争策略。网络竞品分析涉及的信息包括竞争对手的产品、价格、渠道、营销、用户反馈等方面。爬虫技术是一种自动化…

电子商务交易产品质量监测实施指南

声明 本文是学习GB-T 42893-2023 电子商务交易产品质量监测实施指南. 而整理的学习笔记,分享出来希望更多人受益,如果存在侵权请及时联系我们 1 范围 本文件提供了开展电子商务交易的有形产品质量监测的总则&#xff0c;监测准备、监测实施、监测效果评价 与反馈等过程指导…

git的ssh协议走代理拉取代码

1.首先要自己搭建一个代理 https://blog.csdn.net/Jessica_hhh/article/details/133276101https://blog.csdn.net/Jessica_hhh/article/details/133276101 2. 确认机器装过nc&#xff0c;若没有&#xff0c;用yum install -y nc安装 centos 6使用yum安装软件_duang_huang的博…

Machine Learning(study notes)

There is no studying without going crazy Studying alwats drives us crazy 文章目录 DefineMachine LearningSupervised Learning&#xff08;监督学习&#xff09;Regression problemClassidication Unspervised LearningClustering StudyModel representation&#xff08…

多层感知机——MLP

源代码在此处&#xff1a;https://github.com/wepe/MachineLearning/tree/master/DeepLearning Tutorials/mlp 一、多层感知机&#xff08;MLP&#xff09;原理简介 多层感知机&#xff08;MLP&#xff0c;Multilayer Perceptron&#xff09;也叫人工神经网络&#xff08;ANN&…