接前面,在 PortalStart 中调用了 ExecutorStart,ExecutorStart 会调用 InitPlan:/* ---------------------------------------------------------------- * InitPlan * * Initializes the query plan: open files, allocate storage * and start up the rule manager * -----------------------------------------...
转载
2013-05-30 12:12:00
59阅读
2评论
前面说过 PortalStart明确执行策略后,要执行 ExecutorStart。那么ExecutorStart 到底作了什么呢。以下是缩略:/* ---------------------------------------------------------------- * ExecutorStart * * This routine must be called at the beginning of any execution of any * query plan * * Takes a QueryDesc previously crea...
转载
2013-05-22 13:57:00
37阅读
2评论
入口函数为ExplainOnePlan,他会创建一个查询描述结构queryDesc,然后进入执行器执行ExecutorStart、ExecutorRun、ExecutorFinish、Ex...
原创
2022-09-14 10:12:26
531阅读
接前面:/* ---------------------------------------------------------------- * ExecutorRun * * This is the main routine of the executor module. It accepts * the query descriptor from the traffic cop and executes the * query plan. * * ExecutorStart must have been called ...
转载
2013-05-30 15:23:00
28阅读
2评论
在定义了Portal之后,需要运行:PortalStart,它主要的任务是明确执行策略,然后再执行ExecutorStart:代码太长,进行缩略:voidPortalStart(Portal portal, ParamListInfo params, int eflags, bool use_active_snapshot){ ... PG_TRY(); { ActivePortal = portal; CurrentResourceOwner = portal->resowner; PortalContext ...
转载
2013-05-22 13:26:00
35阅读
2评论
接前面,回溯调用关系:exec_simple_query --> PortalStart --> ExecutorStart --> StandardExecutorStart --> InitPlan再回到 exec_simple_query 来:事前知道,表 tst04 对应的文件名为 16393。postgres=# select oid from pg_class where relname='tst04'; oid ------- 16393(1 row)postgres=# 看 exec_simple_query,加点调试信息:static
转载
2013-05-30 13:39:00
63阅读
2评论