better tests for cardinality optimizations