implement TableStats based on histogram on fields