Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PostgreSQL Source Code interpretation (37)-query statement # 22 (query Optimization-grouping_plan...

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

After the main function subquery_planner completes the outer join elimination, the grouping_planner function is then called, and this section briefly introduces the body logic of this function.

I. Source code interpretation

Grouping_planner function source code:

/ *-* grouping_planner * Perform planning steps related to grouping, aggregation, etc. * * generate the "planning steps" * * This function adds all required top-level processing to the scan/join * Path (s) produced by query_planner related to grouping / aggregation. * * this function also handles all scan / connection paths that need to be processed at the top level (generated by the query_planner function) * * If inheritance_update is true, we're being called from inheritance_planner * and should not include a ModifyTable step in the resulting Path (s). * (inheritance_planner will create a single ModifyTable node covering all the * target tables.) * * if the flag inheritance_update is true, the caller of this function is inheritance_planner, and the ModifyTable step should not be included in the result path (inheritance_planner creates a separate ModifyTable node that covers all target tables). * * 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 >

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report