发明授权
- 专利标题: Method and apparatus for exploiting statistics on query expressions for optimization
- 专利标题(中): 利用查询表达式进行统计优化的方法和装置
-
申请号: US11177598申请日: 2005-07-07
-
公开(公告)号: US07363289B2公开(公告)日: 2008-04-22
- 发明人: Surajit Chaudhuri , Nicolas Bruno
- 申请人: Surajit Chaudhuri , Nicolas Bruno
- 申请人地址: US WA Redmond
- 专利权人: Microsoft Corporation
- 当前专利权人: Microsoft Corporation
- 当前专利权人地址: US WA Redmond
- 主分类号: G06F17/30
- IPC分类号: G06F17/30
摘要:
A method for evaluating a user query on a relational database having records stored therein, a workload made up of a set of queries that have been executed on the database, and a query optimizer that generates a query execution plan for the user query. Each query plan includes a plurality of intermediate query plan components that verify a subset of records from the database meeting query criteria. The method accesses the query plan and a set of stored intermediate statistics for records verified by query components, such as histograms that summarize the cardinality of the records that verify the query component. The method forms a transformed query plan based on the selected intermediate statistics (possibly by rewriting the query plan) and estimates the cardinality of the transformed query plan to arrive at a more accurate cardinality estimate for the query. If additional intermediate statistics are necessary, a pool of intermediate statistics may be generated based on the queries in the workload by evaluating the benefit of a given statistic over the workload and adding intermediate statistics to the pool that provide relatively great benefit.
公开/授权文献
信息查询