Add index optimization to 'sample' command.

Basically, if an index is present and the sample size is at most
10% of the total number of records, then sampling is done via
random access.
0.4.16