zoukankan      html  css  js  c++  java
  • PostgreSQL在何处处理 sql查询之十三

    继续:

    /*--------------------
     * grouping_planner
     *      Perform planning steps related to grouping, aggregation, etc.
     *      This primarily means adding top-level processing to the basic
     *      query plan produced by query_planner.
     *
     * tuple_fraction is the fraction of tuples we expect will be retrieved
     *
     * tuple_fraction is interpreted as follows:
     *      0: expect all tuples to be retrieved (normal case)
     *      0 < tuple_fraction < 1: expect the given fraction of tuples available
     *        from the plan to be retrieved
     *      tuple_fraction >= 1: tuple_fraction is the absolute number of tuples
     *        expected to be retrieved (ie, a LIMIT specification)
     *
     * Returns a query plan.  Also, root->query_pathkeys is returned as the
     * actual output ordering of the plan (in pathkey format).
     *--------------------
     */
    static Plan *
    grouping_planner(PlannerInfo *root, double tuple_fraction)
    {
        ...
    
        if (parse->setOperations)
        {
           ...
        }
        else
        {   
    ...
    /* * Generate the best unsorted and presorted paths for this Query (but * note there may not be any presorted path). query_planner will also * estimate the number of groups in the query, and canonicalize all * the pathkeys. */ query_planner(root, sub_tlist, tuple_fraction, sub_limit_tuples, &cheapest_path, &sorted_path, &dNumGroups); ... } /* end of if (setOperations) */ ... return result_plan; }

    此处调用 query_planner

  • 相关阅读:
    2018年全国多校算法寒假训练营练习比赛(第四场)
    STL中的map
    java异常处理
    过滤器与监听器原理详解
    cookie和session机制区别
    servlet运行原理
    $.ajax相关用法
    jdk源码库
    Tomcat 系统架构与设计模式,第 1 部分: 工作原理
    Tomcat源码分析(二)------ 一次完整请求的里里外外
  • 原文地址:https://www.cnblogs.com/gaojian/p/3094769.html
Copyright © 2011-2022 走看看