Implement histogram-based CE for SargableNodes based on the prototype implementation in branch "hist-ce".
The goal of this task is to pick all relevant pieces from the 'hist-ce' branch, and implement basic histogram-based CE as follows:
- Implement the CEInterface interface in a new class (e.g. HistogramCE) similar to the ones for heuristic- and sampling- based CE.
- This new class should provide transport methods for the following Nodes: SargableNode, ScanNode. All other nodes should be processed by a catch-all transport that uses heuristic estimation.
- Figure out how to extract the necessary information from Sargable nodes in order to use a histogram directly to estimate their cardinality.
- Estimate implicit/explicit Boolean expressions inside a single Sargable node via exponential backoff. Reuse the formulas for exponential backoff from
SERVER-67166. - Add an optimizer knob to disable/enable histogram-based CE.
- Implement tests as unit tests. For testing purposes hack around the lack of a statistics module that can provide us histograms. There should be two types of tests:
- Correctness tests - these tests use hand-crafted histograms and predicates that verify that given some known histogram CE produces a certain (hand-verified) estimate.
- Accuracy tests - these tests generate some data, create a histogram, and run the estimator. The result is compared either against a hand-verified result, or to a result produced via running a query over the input dataset. The hist-ce prototype has examples how this is done.
- causes
-
SERVER-68048 Coverity analysis defect 122536: Unsafe assignment operator
- Closed
-
SERVER-68049 Coverity analysis defect 122540: Copy without assign
- Closed