Build the cardinality functionality of MiGrep