发明名称 Query optimization by sub-plan memoization
摘要 Database system query optimizers use several techniques such as histograms and sampling to estimate the result sizes of operators and sub-plans (operator trees) and the number of distinct values in their outputs. These techniques are used despite the fact that they incur estimation errors because they provide inexpensive estimates and result in query execution plans with acceptable performance. For embedded queries that are frequently executed, users may be willing to accept the use of expensive estimation techniques that result in long query optimization times if this leads to choosing faster query execution plans. Instead of estimates, the invention uses the exact actual values of the result sizes and the number of distinct values in the outputs of sub-plans encountered by the optimizer. This is achieved by optimizing the query in phases. In each phase, newly encountered sub-plans are recorded for which result size and/or distinct value estimates are required. These sub-plans are executed at the end of the phase to determine their actual result sizes and the actual number of distinct values in their outputs. In subsequent phases, the optimizer uses these actual values when it encounters the same sub-plan again. This approach, which is referred to as sub-plan memoization, requires query optimization times that may be much longer than the execution times of the queries, but it leads to choosing much faster query execution plans. This makes it very suitable for frequently executed embedded queries.
申请公布号 US2003055813(A1) 申请公布日期 2003.03.20
申请号 US20010858206 申请日期 2001.05.15
申请人 MICROSOFT CORPORATION 发明人 CHAUDHURI SURAJIT;ABOULNAGA ASHRAF I.
分类号 G06F17/30;(IPC1-7):G06F7/00 主分类号 G06F17/30
代理机构 代理人
主权项
地址