欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

PostgreSQL中查詢優(yōu)化的示例分析

小編給大家分享一下PostgreSQL中查詢優(yōu)化的示例分析,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

成都創(chuàng)新互聯(lián)公司長期為上千多家客戶提供的網(wǎng)站建設服務,團隊從業(yè)經(jīng)驗10年,關注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務;打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為大足企業(yè)提供專業(yè)的成都做網(wǎng)站、成都網(wǎng)站制作,大足網(wǎng)站改版等技術服務。擁有十余年豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。

一、總體說明

下面是PG源碼目錄(/src/backend/optimizer)中的README文件對優(yōu)化器相關函數(shù)和數(shù)據(jù)結構的總體說明:

Optimizer Functions
-------------------

The primary entry point is planner().

planner()//優(yōu)化器主入口函數(shù)
set up for recursive handling of subqueries//為子查詢配置處理器(遞歸方式)
-subquery_planner()//調(diào)用(子)查詢優(yōu)化函數(shù)
 pull up sublinks and subqueries from rangetable, if possible//可以的話,上拉子鏈接和子查詢
 canonicalize qual//表達式規(guī)范化
     Attempt to simplify WHERE clause to the most useful form; this includes
     flattening nested AND/ORs and detecting clauses that are duplicated in
     different branches of an OR.//簡化WHERE語句
 simplify constant expressions//簡化常量表達式
 process sublinks//處理子鏈接
 convert Vars of outer query levels into Params//轉換外查詢的Vars變量到Params中
--grouping_planner()//
  preprocess target list for non-SELECT queries//預處理非SELECT語句的投影列
  handle UNION/INTERSECT/EXCEPT, GROUP BY, HAVING, aggregates,//處理集合操作/聚集函數(shù)/排序等
    ORDER BY, DISTINCT, LIMIT
--query_planner()//
   make list of base relations used in query//構造查詢中的基表鏈表
   split up the qual into restrictions (a=1) and joins (b=c)//拆分表達式為限制條件和連接
   find qual clauses that enable merge and hash joins//查找可以讓Merge和Hash連接生效的表達式
----make_one_rel()//
     set_base_rel_pathlists()//設置基表路徑鏈表
      find seqscan and all index paths for each base relation//遍歷每個基表,尋找順序掃描和所有可能的索引掃描路徑
      find selectivity of columns used in joins//查找連接中使用的列的選擇性
     make_rel_from_joinlist()//通過join鏈表構造Relation
      hand off join subproblems to a plugin, GEQO, or standard_join_search()//
-----standard_join_search()//標準的連接搜索函數(shù)
      call join_search_one_level() for each level of join tree needed//每一個join tree調(diào)用join_search_one_level
      join_search_one_level():
        For each joinrel of the prior level, do make_rels_by_clause_joins()//對于上一層的每一個joinrel,執(zhí)行make_rels_by_clause_joins
        if it has join clauses, or make_rels_by_clauseless_joins() if not.
        Also generate "bushy plan" joins between joinrels of lower levels.
      Back at standard_join_search(), generate gather paths if needed for//回到standard_join_search函數(shù),需要的話,收集相關的路徑并應用set_cheapest函數(shù)獲取代價最小的路徑
      each newly constructed joinrel, then apply set_cheapest() to extract
      the cheapest path for it.
      Loop back if this was not the top join level.//如果不是最頂層連接,循環(huán)
  Back at grouping_planner://回到grouping_planner函數(shù)
  do grouping (GROUP BY) and aggregation//處理分組和聚集
  do window functions//處理窗口函數(shù)
  make unique (DISTINCT)//處理唯一性
  do sorting (ORDER BY)//處理排序
  do limit (LIMIT/OFFSET)//處理Limit
Back at planner()://回到planner函數(shù)
convert finished Path tree into a Plan tree//轉換最終的路徑樹到計劃樹
do final cleanup after planning//收尾工作


Optimizer Data Structures
-------------------------

PlannerGlobal   - global information for a single planner invocation//全局優(yōu)化信息

PlannerInfo     - information for planning a particular Query (we make//某個Planner的優(yōu)化信息
                  a separate PlannerInfo node for each sub-Query)

RelOptInfo      - a relation or joined relations//某個Relation(包括連接)的優(yōu)化信息

 RestrictInfo   - WHERE clauses, like "x = 3" or "y = z"//限制條件
                  (note the same structure is used for restriction and
                   join clauses)

 Path           - every way to generate a RelOptInfo(sequential,index,joins)//構造該關系(注意:中間結果也是關系的一種)的路徑
  SeqScan       - represents a sequential scan plan
  IndexPath     - index scan
  BitmapHeapPath - top of a bitmapped index scan
  TidPath       - scan by CTID
  SubqueryScanPath - scan a subquery-in-FROM
  ForeignPath   - scan a foreign table, foreign join or foreign upper-relation
  CustomPath    - for custom scan providers
  AppendPath    - append multiple subpaths together
  MergeAppendPath - merge multiple subpaths, preserving their common sort order
  ResultPath    - a childless Result plan node (used for FROM-less SELECT)
  MaterialPath  - a Material plan node
  UniquePath    - remove duplicate rows (either by hashing or sorting)
  GatherPath    - collect the results of parallel workers
  GatherMergePath - collect parallel results, preserving their common sort order
  ProjectionPath - a Result plan node with child (used for projection)
  ProjectSetPath - a ProjectSet plan node applied to some sub-path
  SortPath      - a Sort plan node applied to some sub-path
  GroupPath     - a Group plan node applied to some sub-path
  UpperUniquePath - a Unique plan node applied to some sub-path
  AggPath       - an Agg plan node applied to some sub-path
  GroupingSetsPath - an Agg plan node used to implement GROUPING SETS
  MinMaxAggPath - a Result plan node with subplans performing MIN/MAX
  WindowAggPath - a WindowAgg plan node applied to some sub-path
  SetOpPath     - a SetOp plan node applied to some sub-path
  RecursiveUnionPath - a RecursiveUnion plan node applied to two sub-paths
  LockRowsPath  - a LockRows plan node applied to some sub-path
  ModifyTablePath - a ModifyTable plan node applied to some sub-path(s)
  LimitPath     - a Limit plan node applied to some sub-path
  NestPath      - nested-loop joins
  MergePath     - merge joins
  HashPath      - hash joins

 EquivalenceClass - a data structure representing a set of values known equal//等價類

 PathKey        - a data structure representing the sort ordering of a path//排序鍵

看完了這篇文章,相信你對“PostgreSQL中查詢優(yōu)化的示例分析”有了一定的了解,如果想了解更多相關知識,歡迎關注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

網(wǎng)頁標題:PostgreSQL中查詢優(yōu)化的示例分析
URL鏈接:http://chinadenli.net/article24/jsisce.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站移動網(wǎng)站建設、品牌網(wǎng)站設計、網(wǎng)站設計公司、網(wǎng)站導航網(wǎng)站建設

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設
亚洲综合一区二区三区在线| 少妇肥臀一区二区三区| 色婷婷国产精品视频一区二区保健| 亚洲第一视频少妇人妻系列| 国产又粗又硬又大又爽的视频| 日韩人妻一区二区欧美| 尤物久久91欧美人禽亚洲| 久久黄片免费播放大全| 午夜福利大片亚洲一区| 国产乱人伦精品一区二区三区四区| 亚洲欧美日韩综合在线成成| 国产一区欧美一区日本道| 欧美激情一区=区三区| 欧美大胆女人的大胆人体| 91香蕉国产观看免费人人| 东京热男人的天堂社区| 国产精品一区二区视频| 91精品国产综合久久福利| 国产又粗又猛又大爽又黄| 加勒比系列一区二区在线观看 | 不卡一区二区在线视频| 亚洲中文在线男人的天堂| 亚洲一区二区三区一区| 少妇人妻无一区二区三区| 国产又大又猛又粗又长又爽| 国产亚洲精品香蕉视频播放| 日本加勒比在线播放一区| 国产91人妻精品一区二区三区| 国产精品激情在线观看| 91精品国自产拍老熟女露脸 | 欧美欧美欧美欧美一区| 九九热这里只有精品视频| 2019年国产最新视频| 91精品国产av一区二区| 亚洲国产精品久久琪琪| 高中女厕偷拍一区二区三区| 亚洲精品中文字幕在线视频| 欧美大粗爽一区二区三区| 久久精品国产99国产免费| 亚洲中文在线中文字幕91| 成年人免费看国产视频|