Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the function of grouping_planner function in PostgreSQL

Shulou Source: shulou.com Published: 2022-05-31 14:48:06 10月02日 Update

This article mainly introduces "what is the function of grouping_planner function in PostgreSQL". In daily operation, I believe that many people have doubts about the function of grouping_planner function in PostgreSQL. Xiaobian consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubt of "what is the function of grouping_planner function in PostgreSQL?" Next, please follow the editor to study!

Source code interpretation

Grouping / aggregation and other operations are superimposed on a Relation. The grouping_planner function first generates a new relationship through the query_planner function, and then attached the grouping / aggregation and other operations on this relationship.

/ *-* grouping_planner * Perform planning steps related to grouping, aggregation, etc. * perform the "planning steps" related to grouping / clustering. * grouping / aggregating operations are superimposed on a Relation. * PG first generates a new relationship through the query_planner function, and then attached grouping / aggregating operations on this relationship * * This function adds all required top-level processing to the scan/join * Path (s) produced by query_planner. * * 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 >

Tags: Function statement grouping clause path processing query information sorting generation node projection step result cost target upper layer tag work output Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi macOS Redmi Shulou Tech Info Docker