CREATE TABLE small_strings (s String) ENGINE = Log INSERT INTO small_strings SELECT number % 10 = 0 ? 'ab' : 'c' FROM numbers_mt(1e9) SELECT count() FROM small_strings WHERE NOT ignore(s) DROP TABLE IF EXISTS small_strings