Statistics for Time-by-example query language for historical databases