PERF: improved cardinality calculation algorithm results in 150% improvement in cold cache performance