Patent ID: 9436733
Filing Date: 2016-09-06
CPC Classification: G06F

Claim Text:
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.