发明名称 Techniques for query statistics inheritance
摘要 Techniques for query statistics inheritance are provided. Statistics for a database are used to determine selectivity estimates for sparse joins and tables being joined together within a given query. These statistics are inherited up to the given query along with the selectivity estimates and provided to a database optimizer to use when developing query plans and selecting an optimal query plan for the given query.
申请公布号 US9436733(B2) 申请公布日期 2016.09.06
申请号 US201213722735 申请日期 2012.12.20
申请人 Teradata US, Inc. 发明人 Korlapati Rama Krishna;Chen Haiyan
分类号 G06F7/00;G06F17/30 主分类号 G06F7/00
代理机构 Schwegman, Lundberg & Woessner, P.A. 代理人 Schwegman, Lundberg & Woessner, P.A.
主权项 1. A method implemented and programmed within a non-transitory computer-readable storage medium and processed by a processor, the processor configured to execute the method, comprising: receiving, via the processor, a query having two tables joined on a column with skewed values; acquiring, via the processor, a set of statistics available for the join; and resolving a priority order for selecting particular portions of the set of statistics after grouping histograms associated with the two tables joined on the column and using the grouped histograms to resolve the priority order, and wherein resolving further includes generating the priority order as 1) firstly identifying a histogram for a database object having a smallest row count; 2) secondly identifying a histogram having a highest sample percentage; 3) thirdly identifying a histogram having a latest version; and 4) fourthly a histogram collected most recently, wherein generating further includes checking each histogram in the priority order to ensure a value range survives after the join, and wherein checking further includes ensuring range conditions on a joined column for the join and row filtering conditions of the database object in the selected histogram.
地址 Dayton OH US