日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

PostgreSQL在何处处理 sql查询之六

發布時間:2024/4/15 数据库 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 PostgreSQL在何处处理 sql查询之六 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前面說過 PortalStart明確執行策略后,要執行 ExecutorStart。

那么ExecutorStart 到底作了什么呢。以下是縮略:

/* ----------------------------------------------------------------* ExecutorStart** This routine must be called at the beginning of any execution of any* query plan** Takes a QueryDesc previously created by CreateQueryDesc (which is separate* only because some places use QueryDescs for utility commands). The tupDesc* field of the QueryDesc is filled in to describe the tuples that will be* returned, and the internal fields (estate and planstate) are set up.** eflags contains flag bits as described in executor.h.** NB: the CurrentMemoryContext when this is called will become the parent* of the per-query context used for this Executor invocation.** We provide a function hook variable that lets loadable plugins* get control when ExecutorStart is called. Such a plugin would* normally call standard_ExecutorStart().** ----------------------------------------------------------------*/ void ExecutorStart(QueryDesc *queryDesc, int eflags) {if (ExecutorStart_hook)(*ExecutorStart_hook) (queryDesc, eflags);elsestandard_ExecutorStart(queryDesc, eflags); }void standard_ExecutorStart(QueryDesc *queryDesc, int eflags) { .../** If non-read-only query, set the command ID to mark output tuples with*/switch (queryDesc->operation){...}/** Copy other important information into the EState*/estate->es_snapshot = RegisterSnapshot(queryDesc->snapshot);estate->es_crosscheck_snapshot = RegisterSnapshot(queryDesc->crosscheck_snapshot);estate->es_top_eflags = eflags;estate->es_instrument = queryDesc->instrument_options;/** Initialize the plan state tree*/InitPlan(queryDesc, eflags);/** Set up an AFTER-trigger statement context, unless told not to, or* unless it's EXPLAIN-only mode (when ExecutorFinish won't be called).*/if (!(eflags & (EXEC_FLAG_SKIP_TRIGGERS | EXEC_FLAG_EXPLAIN_ONLY)))AfterTriggerBeginQuery();MemoryContextSwitchTo(oldcontext); }

核心一條就是,對 ?QueryDesc 型指針所指向的結構,進行了設置,以備后面的使用(ExecutorRun)。

上述代碼的注釋中已經說明:使用了CreateQueryDesc時產生的 QueryDesc,設置其tupDesc。

總結

以上是生活随笔為你收集整理的PostgreSQL在何处处理 sql查询之六的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。