Partition granular selectivity estimation for predicates
AssigneeSnowflake Inc.
InventorsSangyong Hwang, Adem Khachnaoui, Li Yan, Yongsik Yoon
Life of this patent
Estimating the term…
Abstract
A query engine can use partition-granular level statistics to optimize query performance. A query can reference a table with a plurality of partitions and include a predicate. A partition-granular selectivity estimate for the predicate can be generated based on statistics stored regarding the plurality of partitions of the table. A query plan can be generated based on partition-granular selectivity estimate to optimize query processing.
Claims21
A method comprising:
- receiving a query including at least one predicate referencing a table stored in a network-based data system, the table including a plurality of partitions, respective partitions of the plurality of partitions including a group of rows and at least one partition of the plurality of partitions being created in response to new data being written to the table, the at least one partition replacing an older partition;
- retrieving statistics regarding the plurality of partitions of the table;
- generating a partition-granular selectivity estimate for the at least one predicate based on the retrieved statistics;
- generating a query plan based on the partition-granular selectivity estimate;
- and
- executing the query plan to generate results of the query.
A machine-storage medium embodying instructions that, when executed by a machine, cause the machine to perform operations comprising:
- receiving a query including at least one predicate referencing a table stored in a network-based data system, the table including a plurality of partitions, respective partitions of the plurality of partitions including a group of rows and at least one partition of the plurality of partitions being created in response to new data being written to the table, the at least one partition replacing an older partition;
- retrieving statistics regarding the plurality of partitions of the table;
- generating a partition-granular selectivity estimate for the at least one predicate based on the retrieved statistics;
- generating a query plan based on the partition-granular selectivity estimate;
- and
- executing the query plan to generate results of the query.
A system comprising:
- at least one hardware processor;
- and
- at least one memory storing instructions that, when executed by the at least one hardware processor, cause the at least one hardware processor to perform operations comprising:
- receiving a query including at least one predicate referencing a table stored in a network-based data system, the table including a plurality of partitions, respective partitions of the plurality of partitions including a group of rows and at least one partition of the plurality of partitions being created in response to new data being written to the table, the at least one partition replacing an older partition;
- retrieving statistics regarding the plurality of partitions of the table;
- generating a partition-granular selectivity estimate for the at least one predicate based on the retrieved statistics;
- generating a query plan based on the partition-granular selectivity estimate;
- and
- executing the query plan to generate results of the query.
Dependencies are inferred from the claim text.