FoundationDB/sql-layer — pull request #885 by MMcM (2013-08-27 19:52:07+00:00)
Title: Index statistics sampling groundwork

First, fix problems related to histograms for the leading column, which are handled as the first subset of any multi-column histograms. Several places were confused about this, leading to incorrect printing and wasted work. In particular, for the common case of a single column primary key, UPDATE STATISTICS made an effective copy of the whole index in a temporary tree for no reason.

Then the actual groundwork, which is just straightening out row count and sample count in the generator so that they can be different, although they never will be in this branch. (They are already straight in the optimizer.)