Patent ID: 11971888
Assignee: SNOWFLAKE INC.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 0:
1. A method comprising:
receiving a query plan, the query plan comprising a set of query operations, the set of query operations including at least one aggregation and at least one join operation;
analyzing the query plan to identify an aggregation that is redundant;
removing the aggregation based at least in part on the analyzing;
determining at least one aggregation property corresponding to at least one query operation of the query plan;
inserting at least one adaptive aggregation operator in the query plan based at least in part on the at least one aggregation property, the at least one aggregation property comprising a set of aggregation properties, the set of aggregation properties comprising at least a splitability property, the splitability property indicating that the at least one adaptive aggregation operator is inserted below one side of the at least one join operation, the adaptive aggregation operator being configurable between at least two different modes based at least on a threshold reduction rate, the at least two different modes including a passthrough mode and a processing mode, the passthrough mode configuring the adaptive aggregation operator to output the input to the adaptive aggregation operator, the processing mode configuring the adaptive aggregation operator to process the input to the adaptive aggregation operator generating an output that is different than the input to the adaptive aggregation operator; and
generating a modified query plan based at least in part on the inserted at least one adaptive aggregation operator in the query plan, the generated modified query plan configured to, during the execution of the modified query plan, (1) identify a reduction rate during execution of the modified query plan, and (2) based on the identified reduction rate and the threshold reduction rate, switch configuration of the adaptive aggregation operator between the passthrough mode and the processing mode, the reduction rate indicative of a runtime cost-efficiency metric for the execution of the modified query plan.