Statistical data should be used by the relational engine in order to calculate operation cost. The following values could be got from statistical data: smallest and largest value, number of values and cardinality. Medium cardinality should be calculated this way: number of values / number of records (from table header)
[Statistical_data] should be stored in index-like B+ tree structures. These structures should be read / written using the physical layer. Statistical data should contain cardinality (number of records) for every value stored in a given field. Statistical data should be created for every non-unique field (cardinality of values in a unique index is always 1). They should be updated when a record is updated, at the same time as records and indexes.