老熟女激烈的高潮_日韩一级黄色录像_亚洲1区2区3区视频_精品少妇一区二区三区在线播放_国产欧美日产久久_午夜福利精品导航凹凸

重慶分公司,新征程啟航

為企業提供網站建設、域名注冊、服務器等服務

PostgreSQL中查詢優化的示例分析

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

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

一、總體說明

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

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

The primary entry point is planner().

planner()//優化器主入口函數
set up for recursive handling of subqueries//為子查詢配置處理器(遞歸方式)
-subquery_planner()//調用(子)查詢優化函數
 pull up sublinks and subqueries from rangetable, if possible//可以的話,上拉子鏈接和子查詢
 canonicalize qual//表達式規范化
     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,//處理集合操作/聚集函數/排序等
    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()//標準的連接搜索函數
      call join_search_one_level() for each level of join tree needed//每一個join tree調用join_search_one_level
      join_search_one_level():
        For each joinrel of the prior level, do make_rels_by_clause_joins()//對于上一層的每一個joinrel,執行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函數,需要的話,收集相關的路徑并應用set_cheapest函數獲取代價最小的路徑
      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.//如果不是最頂層連接,循環
  Back at grouping_planner://回到grouping_planner函數
  do grouping (GROUP BY) and aggregation//處理分組和聚集
  do window functions//處理窗口函數
  make unique (DISTINCT)//處理唯一性
  do sorting (ORDER BY)//處理排序
  do limit (LIMIT/OFFSET)//處理Limit
Back at planner()://回到planner函數
convert finished Path tree into a Plan tree//轉換最終的路徑樹到計劃樹
do final cleanup after planning//收尾工作


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

PlannerGlobal   - global information for a single planner invocation//全局優化信息

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

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

 RestrictInfo   - WHERE clauses, like "x = 3" or "y = z"http://限制條件
                  (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中查詢優化的示例分析”有了一定的了解,如果想了解更多相關知識,歡迎關注創新互聯行業資訊頻道,感謝各位的閱讀!


網站欄目:PostgreSQL中查詢優化的示例分析
文章來源:http://www.xueling.net.cn/article/jsisce.html

其他資訊

在線咨詢
服務熱線
服務熱線:028-86922220
TOP
主站蜘蛛池模板: 精品99在线视频 | 岳的好大精品一区二区三区 | 久久人人妻人人爽人人卡片av | 992人人草 | 日韩免费黄色大片 | 欧美综合图区 | 99一级片 | 国产精品久久久久久久妇女 | 视频福利一区 | 一本久久综合亚洲鲁鲁五月天 | 久久大香伊蕉在人线免费 | 亚洲精品在线播放 | 成人av一区二区三区在线观看 | 情侣做性视频在线播放 | 男人操女人视频免费观看 | 国产男女视频网站 | 亚洲国产精品ⅴa在线观看 免费日韩网站 | 亚洲欧美国产国产综合一区 | 亚洲影院天堂 | 中文字幕日本视频 | 久久综合免费视频影院 | 曰韩无码二三区中文字幕 | JAPANESE高潮流白浆 | 免费se99se| 亚洲一区日韩欧美 | 影音先锋人妻啪啪AV资源网站 | 精品国产国产综合精品 | 4d玉蒲团奶水都喷出来了免费 | 国产亚洲高清一区 | 日韩在线观看视频免费 | 全球AV集中精品导航福利 | 黑人巨茎美女高潮视频 | 国产亚洲专区 | 欧美性一区 | 秀人网免费观看 | 亚洲精品成人无限看 | 免费在线播放黄色 | 高潮视频在线播放 | 又粗又大又硬毛片免费看 | www.色小妹.com| 综合自拍偷拍 |