A method for optimizing the construction of a KStore includes providing a
data set having a plurality of records with a plurality of fields,
providing an optimization structure from a sample of the data set and
analyzing the optimization structure to determine a field order for the
records contained in the data set. A KStore is provided from the data set
in accordance with the field order. The sample of the data set can
include the entire data set, a random sample of the data set or a
predetermined number of records from the data set. The data set has an
initial order having earlier records and later records and the sample can
include a plurality of the earlier records. The sample of the data set
includes a user determined number of records from the data set. The
optimization structure can be a KStore.