Postgresql源码(127)投影ExecProject的表达式执行分析

无论是投影还是别的计算,表达式执行的入口和计算逻辑都是统一的,这里已投影为分析表达式执行的流程。

1 投影函数

用例

create table t1(i int primary key, j int, k int);
insert into t1 select i, i % 10, i % 100 from generate_series(1,10000000) t(i);
explain analyze select abs(k),abs(k),abs(k),abs(k),abs(k),exp(k),exp(k),exp(k),exp(k),exp(k) from t1;

对于这样这一条查询来说,每扫描一行,都会调用投影函数ExecProject,完成最终结果的构造。

投影函数:

static inline TupleTableSlot *
ExecProject(ProjectionInfo *projInfo)
{ExprContext *econtext = projInfo->pi_exprContext;ExprState  *state = &projInfo->pi_state;TupleTableSlot *slot = state->resultslot;bool		isnull;/** Clear any former contents of the result slot.  This makes it safe for* us to use the slot's Datum/isnull arrays as workspace.*/ExecClearTuple(slot);/* Run the expression, discarding scalar result from the last column. */(void) ExecEvalExprSwitchContext(state, econtext, &isnull);/** Successfully formed a result row.  Mark the result slot as containing a* valid virtual tuple (inlined version of ExecStoreVirtualTuple()).*/slot->tts_flags &= ~TTS_FLAG_EMPTY;slot->tts_nvalid = slot->tts_tupleDescriptor->natts;return slot;
}

总结:

  • projInfo->pi_exprContext记录了需要执行表达式的上下文信息
    • 具体存放:t1表扫出来的一行
    • 具体存放:表达式执行的内存上下文
  • projInfo->pi_state记录了表达式执行状态
    • 具体存放:表达式执行的每一个step,每一个step放到ExecInterpExpr中按顺序执行得到最终结果tuple。

2.1 表达式执行上下文结构ExprContext

其中ecxt_scantuple用来保存待处理输入tuple,通常指向一个 tuple table slot。

ExprContext *econtext = {type = T_ExprContext,ecxt_scantuple = 0x1520918,    <<<<<<<< 待处理tupleecxt_innertuple = 0x0,ecxt_outertuple = 0x0,ecxt_per_query_memory = 0x15203e0,ecxt_per_tuple_memory = 0x151e3d0,ecxt_param_exec_vals = 0x0,ecxt_param_list_info = 0x0,ecxt_aggvalues = 0x0,ecxt_aggnulls = 0x0,caseValue_datum = 0,caseValue_isNull = true,domainValue_datum = 0,domainValue_isNull = true,ecxt_estate = 0x15204e0,ecxt_callbacks = 0x0
}

2.2 表达式执行状态ExprState

ExprState  *state = {type = T_ExprState,flags = 6 '\006',resnull = false,resvalue = 0,resultslot = 0x151f278,steps = 0x1525c38,evalfunc = 0x74d749 <ExecInterpExprStillValid>,expr = 0x24c9618,evalfunc_private = 0x74af83 <ExecInterpExpr>,steps_len = 37,steps_alloc = 64,parent = 0x151e718,ext_params = 0x0,innermost_caseval = 0x0,innermost_casenull = 0x0,innermost_domainval = 0x0,innermost_domainnull = 0x0,escontext = 0x0
}

注意实际执行使用ExecInterpExpr函数完成表达式计算:

2.3 执行表达式

执行时,通过state->evalfunc函数完成具体的表达式计算动作。具体怎么计算流程放在steps中:

(gdb) p/x state->steps[0]->opcode
$15 = 0x74b0ad
(gdb) p/x state->steps[1]->opcode
$16 = 0x74b1ec
(gdb) p/x state->steps[2]->opcode
$17 = 0x74b784
(gdb) p/x state->steps[3]->opcode
$18 = 0x74b591
(gdb) p/x state->steps[4]->opcode
$19 = 0x74b1ec
(gdb) p/x state->steps[5]->opcode
$20 = 0x74b784
(gdb) p/x state->steps[6]->opcode
$21 = 0x74b591
(gdb) p/x state->steps[7]->opcode
$22 = 0x74b1ec
...
...

opcode需要再reverse_dispatch_table中确定当前计算走哪个ExecInterpExpr中的分支:

(这里不太方便调试因为这里把一个超大的switch case改成了goto,为了性能!)

p reverse_dispatch_table
$13 = {{opcode = 0x74b01a <ExecInterpExpr+151>,op = EEOP_DONE}, {opcode = 0x74b041 <ExecInterpExpr+190>,op = EEOP_INNER_FETCHSOME}, {opcode = 0x74b077 <ExecInterpExpr+244>,op = EEOP_OUTER_FETCHSOME}, {opcode = 0x74b0ad <ExecInterpExpr+298>,op = EEOP_SCAN_FETCHSOME}, {opcode = 0x74b0e6 <ExecInterpExpr+355>,op = EEOP_INNER_VAR}, {opcode = 0x74b169 <ExecInterpExpr+486>,op = EEOP_OUTER_VAR}, {opcode = 0x74b1ec <ExecInterpExpr+617>,op = EEOP_SCAN_VAR}, {opcode = 0x74b26f <ExecInterpExpr+748>,op = EEOP_INNER_SYSVAR}, {opcode = 0x74b29e <ExecInterpExpr+795>,op = EEOP_OUTER_SYSVAR}, {opcode = 0x74b2cd <ExecInterpExpr+842>,op = EEOP_SCAN_SYSVAR}, {opcode = 0x74b2fc <ExecInterpExpr+889>,op = EEOP_WHOLEROW}, {opcode = 0x74b32a <ExecInterpExpr+935>,op = EEOP_ASSIGN_INNER_VAR}, {opcode = 0x74b3f7 <ExecInterpExpr+1140>,op = EEOP_ASSIGN_OUTER_VAR}, {opcode = 0x74b4c4 <ExecInterpExpr+1345>,op = EEOP_ASSIGN_SCAN_VAR}, {opcode = 0x74b591 <ExecInterpExpr+1550>,op = EEOP_ASSIGN_TMP}, {opcode = 0x74b615 <ExecInterpExpr+1682>,op = EEOP_ASSIGN_TMP_MAKE_RO}, {opcode = 0x74b6e1 <ExecInterpExpr+1886>,op = EEOP_CONST}, {opcode = 0x74b717 <ExecInterpExpr+1940>,op = EEOP_FUNCEXPR}, {opcode = 0x74b784 <ExecInterpExpr+2049>,op = EEOP_FUNCEXPR_STRICT}, {opcode = 0x74b853 <ExecInterpExpr+2256>,op = EEOP_FUNCEXPR_FUSAGE}, {opcode = 0x74b881 <ExecInterpExpr+2302>,op = EEOP_FUNCEXPR_STRICT_FUSAGE}, {opcode = 0x74b8af <ExecInterpExpr+2348>,op = EEOP_BOOL_AND_STEP_FIRST}, {opcode = 0x74b8ba <ExecInterpExpr+2359>,op = EEOP_BOOL_AND_STEP}, {opcode = 0x74b92c <ExecInterpExpr+2473>,op = EEOP_BOOL_AND_STEP_LAST}, {opcode = 0x74b98f <ExecInterpExpr+2572>,op = EEOP_BOOL_OR_STEP_FIRST}, {opcode = 0x74b99a <ExecInterpExpr+2583>,op = EEOP_BOOL_OR_STEP}, {opcode = 0x74ba09 <ExecInterpExpr+2694>,op = EEOP_BOOL_OR_STEP_LAST}, {opcode = 0x74ba69 <ExecInterpExpr+2790>,op = EEOP_BOOL_NOT_STEP}, {opcode = 0x74bab3 <ExecInterpExpr+2864>,op = EEOP_QUAL}, {opcode = 0x74bb38 <ExecInterpExpr+2997>,op = EEOP_JUMP}, {opcode = 0x74bb63 <ExecInterpExpr+3040>,op = EEOP_JUMP_IF_NULL}, {opcode = 0x74bbae <ExecInterpExpr+3115>,op = EEOP_JUMP_IF_NOT_NULL}, {opcode = 0x74bbfc <ExecInterpExpr+3193>,op = EEOP_JUMP_IF_NOT_TRUE}, {opcode = 0x74bc61 <ExecInterpExpr+3294>,op = EEOP_NULLTEST_ISNULL}, {opcode = 0x74bc9d <ExecInterpExpr+3354>,op = EEOP_NULLTEST_ISNOTNULL}, {opcode = 0x74bcea <ExecInterpExpr+3431>,op = EEOP_NULLTEST_ROWISNULL}, {opcode = 0x74bd18 <ExecInterpExpr+3477>,op = EEOP_NULLTEST_ROWISNOTNULL}, {opcode = 0x74bd46 <ExecInterpExpr+3523>,op = EEOP_BOOLTEST_IS_TRUE}, {opcode = 0x74bd86 <ExecInterpExpr+3587>,op = EEOP_BOOLTEST_IS_NOT_TRUE}, {opcode = 0x74be01 <ExecInterpExpr+3710>,op = EEOP_BOOLTEST_IS_FALSE}, {opcode = 0x74be7c <ExecInterpExpr+3833>,op = EEOP_BOOLTEST_IS_NOT_FALSE}, {opcode = 0x74bebc <ExecInterpExpr+3897>,op = EEOP_PARAM_EXEC}, {opcode = 0x74beea <ExecInterpExpr+3943>,op = EEOP_PARAM_EXTERN}, {opcode = 0x74bf18 <ExecInterpExpr+3989>,op = EEOP_PARAM_CALLBACK}, {opcode = 0x74bf48 <ExecInterpExpr+4037>,op = EEOP_CASE_TESTVAL}, {opcode = 0x74bfbe <ExecInterpExpr+4155>,op = EEOP_DOMAIN_TESTVAL}, {opcode = 0x74c034 <ExecInterpExpr+4273>,op = EEOP_MAKE_READONLY}, {opcode = 0x74c08a <ExecInterpExpr+4359>,op = EEOP_IOCOERCE}, {opcode = 0x74c26c <ExecInterpExpr+4841>,op = EEOP_IOCOERCE_SAFE}, {opcode = 0x74c293 <ExecInterpExpr+4880>,op = EEOP_DISTINCT}, {opcode = 0x74c3a6 <ExecInterpExpr+5155>,op = EEOP_NOT_DISTINCT}, {opcode = 0x74c496 <ExecInterpExpr+5395>,op = EEOP_NULLIF}, {opcode = 0x74c57f <ExecInterpExpr+5628>,op = EEOP_SQLVALUEFUNCTION}, {opcode = 0x74c5a6 <ExecInterpExpr+5667>,op = EEOP_CURRENTOFEXPR}, {opcode = 0x74c5cd <ExecInterpExpr+5706>,op = EEOP_NEXTVALUEEXPR}, {opcode = 0x74c5f4 <ExecInterpExpr+5745>,op = EEOP_ARRAYEXPR}, {opcode = 0x74c61b <ExecInterpExpr+5784>,op = EEOP_ARRAYCOERCE}, {opcode = 0x74c649 <ExecInterpExpr+5830>,op = EEOP_ROW}, {opcode = 0x74c670 <ExecInterpExpr+5869>,op = EEOP_ROWCOMPARE_STEP}, {opcode = 0x74c7be <ExecInterpExpr+6203>,op = EEOP_ROWCOMPARE_FINAL}, {opcode = 0x74c8cf <ExecInterpExpr+6476>,op = EEOP_MINMAX}, {opcode = 0x74c8f6 <ExecInterpExpr+6515>,op = EEOP_FIELDSELECT}, {opcode = 0x74c924 <ExecInterpExpr+6561>,op = EEOP_FIELDSTORE_DEFORM}, {opcode = 0x74c952 <ExecInterpExpr+6607>,op = EEOP_FIELDSTORE_FORM}, {opcode = 0x74c980 <ExecInterpExpr+6653>,op = EEOP_SBSREF_SUBSCRIPTS}, {opcode = 0x74c9df <ExecInterpExpr+6748>,op = EEOP_SBSREF_OLD}, {opcode = 0x74c9e1 <ExecInterpExpr+6750>,op = EEOP_SBSREF_ASSIGN}, {opcode = 0x74c9e1 <ExecInterpExpr+6750>,op = EEOP_SBSREF_FETCH}, {opcode = 0x74ca11 <ExecInterpExpr+6798>,op = EEOP_CONVERT_ROWTYPE}, {opcode = 0x74ca3f <ExecInterpExpr+6844>,op = EEOP_SCALARARRAYOP}, {opcode = 0x74ca66 <ExecInterpExpr+6883>,op = EEOP_HASHED_SCALARARRAYOP}, {opcode = 0x74ca94 <ExecInterpExpr+6929>,op = EEOP_DOMAIN_NOTNULL}, {opcode = 0x74cabb <ExecInterpExpr+6968>,op = EEOP_DOMAIN_CHECK}, {opcode = 0x74cae2 <ExecInterpExpr+7007>,op = EEOP_XMLEXPR}, {opcode = 0x74cb09 <ExecInterpExpr+7046>,op = EEOP_JSON_CONSTRUCTOR}, {opcode = 0x74cb37 <ExecInterpExpr+7092>,op = EEOP_IS_JSON}, {opcode = 0x74cb5e <ExecInterpExpr+7131>,op = EEOP_JSONEXPR_PATH}, {opcode = 0x74cb9f <ExecInterpExpr+7196>,op = EEOP_JSONEXPR_COERCION}, {opcode = 0x74cbcd <ExecInterpExpr+7242>,op = EEOP_JSONEXPR_COERCION_FINISH}, {opcode = 0x74cbf4 <ExecInterpExpr+7281>,op = EEOP_AGGREF}, {opcode = 0x74cc82 <ExecInterpExpr+7423>,op = EEOP_GROUPING_FUNC}, {opcode = 0x74cca9 <ExecInterpExpr+7462>,op = EEOP_WINDOW_FUNC}, {opcode = 0x74cd40 <ExecInterpExpr+7613>,op = EEOP_MERGE_SUPPORT_FUNC}, {opcode = 0x74cd6e <ExecInterpExpr+7659>,op = EEOP_SUBPLAN}, {opcode = 0x74cd9c <ExecInterpExpr+7705>,op = EEOP_AGG_STRICT_DESERIALIZE}, {opcode = 0x74cdd7 <ExecInterpExpr+7764>,op = EEOP_AGG_DESERIALIZE}, {opcode = 0x74ce8a <ExecInterpExpr+7943>,op = EEOP_AGG_STRICT_INPUT_CHECK_ARGS}, {opcode = 0x74cf18 <ExecInterpExpr+8085>,op = EEOP_AGG_STRICT_INPUT_CHECK_NULLS}, {opcode = 0x74cf9f <ExecInterpExpr+8220>,op = EEOP_AGG_PLAIN_PERGROUP_NULLCHECK}, {opcode = 0x74d02c <ExecInterpExpr+8361>,op = EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL}, {opcode = 0x74d147 <ExecInterpExpr+8644>,op = EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL}, {opcode = 0x74d22c <ExecInterpExpr+8873>,op = EEOP_AGG_PLAIN_TRANS_BYVAL}, {opcode = 0x74d2fb <ExecInterpExpr+9080>,op = EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF}, {opcode = 0x74d413 <ExecInterpExpr+9360>,op = EEOP_AGG_PLAIN_TRANS_STRICT_BYREF}, {opcode = 0x74d4f5 <ExecInterpExpr+9586>,op = EEOP_AGG_PLAIN_TRANS_BYREF}, {opcode = 0x74d5c1 <ExecInterpExpr+9790>,op = EEOP_AGG_PRESORTED_DISTINCT_SINGLE}, {opcode = 0x74d648 <ExecInterpExpr+9925>,op = EEOP_AGG_PRESORTED_DISTINCT_MULTI}, {opcode = 0x74d6cf <ExecInterpExpr+10060>,op = EEOP_AGG_ORDERED_TRANS_DATUM}, {opcode = 0x74d6fd <ExecInterpExpr+10106>,op = EEOP_AGG_ORDERED_TRANS_TUPLE}}

翻译后

(gdb) p/x state->steps[0]->opcode
$15 = 0x74b0ad                       EEOP_SCAN_FETCHSOME
(gdb) p/x state->steps[1]->opcode
$16 = 0x74b1ec                       EEOP_SCAN_VAR
(gdb) p/x state->steps[2]->opcode
$17 = 0x74b784                       EEOP_FUNCEXPR_STRICT
(gdb) p/x state->steps[3]->opcode
$18 = 0x74b591                       EEOP_ASSIGN_TMP
(gdb) p/x state->steps[4]->opcode
$19 = 0x74b1ec                       EEOP_SCAN_VAR
(gdb) p/x state->steps[5]->opcode
$20 = 0x74b784                       EEOP_FUNCEXPR_STRICT
(gdb) p/x state->steps[6]->opcode
$21 = 0x74b591                       EEOP_ASSIGN_TMP
(gdb) p/x state->steps[7]->opcode
$22 = 0x74b1ec                       EEOP_SCAN_VAR
...
...
(gdb) p/x state->steps[34]->opcode
$27 = 0x74b784                       EEOP_FUNCEXPR_STRICT
(gdb) p/x state->steps[35]->opcode
$28 = 0x74b591                       EEOP_ASSIGN_TMP
(gdb) p/x state->steps[36]->opcode
$29 = 0x74b01a                       EEOP_DONE

可以看到表达式计算的流程:

第一步:EEOP_SCAN_FETCHSOME
  1. 从econtext->ecxt_scantuple读取到scanslot(当前要处理的一行数据)
  2. slot_getsomeattrs函数确保这一行数据中,至少有op->d.fetch.last_var个列是可以直接访问的(这里是3,因为t1表就三列,后面的处理可能需要访问这三列的任意一列)。为什么说有时不能直接访问,因为列有可能指向toast表。
		EEO_CASE(EEOP_SCAN_FETCHSOME){CheckOpSlotCompatibility(op, scanslot);slot_getsomeattrs(scanslot, op->d.fetch.last_var);EEO_NEXT();}
第二步:EEOP_SCAN_VAR

输入

p state->steps[1].d.fetch
$46 = {last_var = 2,fixed = 23,known_desc = 0x0,kind = 0x0
}

执行,从行中拿到第2列的值(0列、1列、2列)

		EEO_CASE(EEOP_SCAN_VAR){int			attnum = op->d.var.attnum;   // attnum = 2/* See EEOP_INNER_VAR comments */Assert(attnum >= 0 && attnum < scanslot->tts_nvalid);*op->resvalue = scanslot->tts_values[attnum];*op->resnull = scanslot->tts_isnull[attnum];EEO_NEXT();}

结果

(gdb) p state->steps[1].resvalue
$41 = (Datum *) 0x151f918
(gdb) p *state->steps[1].resvalue
$39 = 1(gdb) p state->steps[1].resnull
$42 = (_Bool *) 0x151f920
(gdb) p *state->steps[1].resnull
$40 = false
第三步:EEOP_FUNCEXPR_STRICT

输入

(gdb) p state->steps[2].d.func
$47 = {finfo = 0x151f8a8,fcinfo_data = 0x151f8f8,fn_addr = 0xa8ea89 <int4abs>,nargs = 1
}

执行

		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();}

注意这里有一个地方很有意思,按理说EEOP_SCAN_VAR执行完才把值拿到,但从EEOP_FUNCEXPR_STRICT的执行来看,并没有发现把前一步的结果,放到函数args的步骤。

但是从GDB来看,函数的入参的地址和上一步取值后存放结果的地址是相同的,也就是上一步取值就是为了拿入参的args:

(gdb) p state->steps[4].resvalue
$59 = (Datum *) 0x151f9b8(gdb) p state->steps[5].d.func->fcinfo_data->args
$58 = 0x151f9b8

具体是怎么做到的呢?在构造steps时:
在这里插入图片描述
对于函数入参value会调用ExecInitExprRec去取值,在这个过程中,把参数的value指向新step的resvalue:
在这里插入图片描述
而这个新的step就是EEOP_SCAN_VAR:
在这里插入图片描述

第四步:暂存结果集

暂存结果集到resultslot中:

		EEO_CASE(EEOP_ASSIGN_TMP){int			resultnum = op->d.assign_tmp.resultnum;Assert(resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);resultslot->tts_values[resultnum] = state->resvalue;resultslot->tts_isnull[resultnum] = state->resnull;EEO_NEXT();}
第五步:继续上述流程直到执行完成
(gdb) p/x state->steps[0]->opcode
$15 = 0x74b0ad                       EEOP_SCAN_FETCHSOME   第一步
(gdb) p/x state->steps[1]->opcode
$16 = 0x74b1ec                       EEOP_SCAN_VAR         第二步
(gdb) p/x state->steps[2]->opcode
$17 = 0x74b784                       EEOP_FUNCEXPR_STRICT  第三步
(gdb) p/x state->steps[3]->opcode
$18 = 0x74b591                       EEOP_ASSIGN_TMP       第四步
(gdb) p/x state->steps[4]->opcode
$19 = 0x74b1ec                       EEOP_SCAN_VAR         第五步 和上述流程相同,每个函数的执行流程都是相似的
(gdb) p/x state->steps[5]->opcode
$20 = 0x74b784                       EEOP_FUNCEXPR_STRICT
(gdb) p/x state->steps[6]->opcode
$21 = 0x74b591                       EEOP_ASSIGN_TMP
(gdb) p/x state->steps[7]->opcode
$22 = 0x74b1ec                       EEOP_SCAN_VAR
...
...
(gdb) p/x state->steps[34]->opcode
$27 = 0x74b784                       EEOP_FUNCEXPR_STRICT
(gdb) p/x state->steps[35]->opcode
$28 = 0x74b591                       EEOP_ASSIGN_TMP
(gdb) p/x state->steps[36]->opcode
$29 = 0x74b01a                       EEOP_DONE

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

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

国家开放大学2024年春《Matlab语言及其应用》实验五Simulink系统 建模与仿真参考答案

答案&#xff1a;更多答案&#xff0c;请关注【电大搜题】微信公众号 答案&#xff1a;更多答案&#xff0c;请关注【电大搜题】微信公众号 答案&#xff1a;更多答案&#xff0c;请关注【电大搜题】微信公众号 实验报告 姓名&#xff1a; 学号&#xff1a; 实验五名称…

数据挖掘之基于Lightgbm等多模型消融实验的信用欺诈检测实现

欢迎大家点赞、收藏、关注、评论啦 &#xff0c;由于篇幅有限&#xff0c;只展示了部分核心代码。 文章目录 一项目简介 二、功能三、系统四. 总结 一项目简介 一、项目背景 在当前的金融环境中&#xff0c;信用欺诈行为日益增多&#xff0c;给金融机构和消费者带来了巨大的损…

基于语音识别的智能电子病历(一)

引子 A&#xff1a;“上周开年会了&#xff01;” 俺&#xff1a;“有啥新的动向&#xff1f;” A&#xff1a;“今年计划开发基于语音识别的智能电子病历。老板说这个算是国内首创&#xff01;” 俺&#xff1a;“嗯&#xff0c;俺做这个20多年了。” A&#xff1a;“语言…

电脑装了两个Win10系统,怎么修改其名称方便识别?

前言 有小伙伴在上一期的双系统教程上留言说怎么修改双系统引导时候显示的名称 不然看起来两个系统好像都没啥分别&#xff0c;如果是Windows10Windows11的方案还好说&#xff0c;但如果是两个Windows10或者是两个Windows11&#xff0c;有时候还真的很不好分辨。 万一想要启动…

从MySQL+MyCAT架构升级为分布式数据库,百丽应用OceanBase 4.2的感受分享

本文来自OceanBase的客户&#xff0c;百丽时尚的使用和测试分享 业务背景 百丽时尚集团&#xff0c;作为国内大型时尚鞋服集团&#xff0c;在中国超过300个城市设有直营门店&#xff0c;数量超过9,000家。集团构建了以消费者需求为核心的垂直一体化业务模式&#xff0c;涵盖了…

C++11:shared_ptr循环引用问题

一、shared_ptr的弊端 struct Listnode {int _val;std::shared_ptr<Listnode> _prev;std::shared_ptr<Listnode> _next;Listnode(int val ):_val(val),_prev(nullptr),_next(nullptr){}~Listnode(){cout << "~Listnode()" << endl;} }; in…

Macos M3 FastGpt部署实现文档问答

前言 经过 Macos安装OrbStack-CSDN博客 Centos8安装docker-compose-CSDN博客 两篇文章的铺垫&#xff0c;可以正式在mac m芯片系列的电脑上使用docker安装项目了 什么是FastGpt FastGPT 是一个基于 LLM 大语言模型的知识库问答系统&#xff0c;提供开箱即用的数据处理、模…

【HarmonyOS4学习笔记】《HarmonyOS4+NEXT星河版入门到企业级实战教程》课程学习笔记(七)

课程地址&#xff1a; 黑马程序员HarmonyOS4NEXT星河版入门到企业级实战教程&#xff0c;一套精通鸿蒙应用开发 &#xff08;本篇笔记对应课程第 14 节&#xff09; P14《13.ArkUI组件-自定义组件》 将可变部分封装成组件的成员变量&#xff1a; 1、首先给标题添加两个图标&am…

计算机网络4——网络层4内部路由选择协议

文章目录 一、有关路由选择协议的几个基本概念1、理想的路由算法2、分层次的路由选择协议 二、内部网关协议 RIP1、协议 RIP 的工作原理2、特点3、距离向量算法4、坏消息传播慢 三、内部网关协议 OSPF1、基本特点2、OSPF 的五种分组类型 本节将讨论几种常用的路由选择协议&…

chrome和drive安装包路径

Chrome for Testing availability (googlechromelabs.github.io) 下载Stable下面的包哈

Mysql从入门到精通——Mysql知识点总结(基础篇)

参考视频 黑马程序员 MySQL数据库入门到精通i 题单推荐 入门 进阶 SQL语句类型 DDL:数据定义语言&#xff0c;用来定义数据库对象(数据库&#xff0c;表&#xff0c;字段)DML:数据操作语言&#xff0c;对数据库表中的数据进行增删改DQL:数据查询语言,用来查询数据库中表的…

音视频入门基础:像素格式专题(1)——RGB简介

一、像素格式简介 像素格式&#xff08;pixel format&#xff09;指像素色彩按分量的大小和排列。这种格式以每个像素所使用的总位数以及用于存储像素色彩的红、绿、蓝和 alpha 分量的位数指定。在音视频领域&#xff0c;常用的像素格式包括RGB格式和YUV格式&#xff0c;本文…