A Novel Approach for Automatic Global Statistics Collection in Distributed Database Systems
摘要
Query optimization is an important phase in query processing for relational databases. Query optimizers depend on table statistics to estimate the cost of the query plan. Stale statistics, resulting from frequently changing data, can result in a poor choice of query plan. Maintaining updated statistics in distributed SQL databases often poses challenges as keeping track of changes in partitioned data is not trivial. In this context, we present a novel approach for automatic collection of statistics for distributed SQL databases. We have implemented our solution on YugabyteDB, which currently requires manual generation of statistics by running a command. We present results from experiments demonstrating the efficacy of the proposed solution in dynamic databases. We also illustrate the effectiveness of the plans generated by this solution on the TPC-H dataset. Besides, our solution reduces the overhead of calculation of statistics by the nodes serving write queries.