CREATE TABLE IF NOT EXISTS prune_field ( ts TIMESTAMP TIME INDEX, `tag` UInt16, a UInt8, b UInt8, PRIMARY KEY (`tag`)) ENGINE = mito WITH('merge_mode'='last_non_null'); Affected Rows: 0 insert into prune_field(ts, `tag`, a, b) values(0, 1, 1, null); Affected Rows: 1 admin flush_table('prune_field'); +----------------------------------+ | ADMIN flush_table('prune_field') | +----------------------------------+ | 0 | +----------------------------------+ insert into prune_field(ts, `tag`, a, b) values(0, 1, null, 1); Affected Rows: 1 admin flush_table('prune_field'); +----------------------------------+ | ADMIN flush_table('prune_field') | +----------------------------------+ | 0 | +----------------------------------+ select * from prune_field where a = 1; +---------------------+-----+---+---+ | ts | tag | a | b | +---------------------+-----+---+---+ | 1970-01-01T00:00:00 | 1 | 1 | 1 | +---------------------+-----+---+---+ select * from prune_field where b = 1; +---------------------+-----+---+---+ | ts | tag | a | b | +---------------------+-----+---+---+ | 1970-01-01T00:00:00 | 1 | 1 | 1 | +---------------------+-----+---+---+ select * from prune_field; +---------------------+-----+---+---+ | ts | tag | a | b | +---------------------+-----+---+---+ | 1970-01-01T00:00:00 | 1 | 1 | 1 | +---------------------+-----+---+---+ select * from prune_field where a = 1 and b = 1; +---------------------+-----+---+---+ | ts | tag | a | b | +---------------------+-----+---+---+ | 1970-01-01T00:00:00 | 1 | 1 | 1 | +---------------------+-----+---+---+ drop table prune_field; Affected Rows: 0 -- -0.0 equals 0.0, so flushed rows holding either zero must keep matching. CREATE TABLE prune_float_zero (ts TIMESTAMP TIME INDEX, v DOUBLE); Affected Rows: 0 insert into prune_float_zero values (1, -0.0), (2, 0.0), (3, 1.0); Affected Rows: 3 admin flush_table('prune_float_zero'); +---------------------------------------+ | ADMIN flush_table('prune_float_zero') | +---------------------------------------+ | 0 | +---------------------------------------+ select ts from prune_float_zero where v = 0.0 order by ts; +-------------------------+ | ts | +-------------------------+ | 1970-01-01T00:00:00.001 | | 1970-01-01T00:00:00.002 | +-------------------------+ select ts from prune_float_zero where v >= 0 order by ts; +-------------------------+ | ts | +-------------------------+ | 1970-01-01T00:00:00.001 | | 1970-01-01T00:00:00.002 | | 1970-01-01T00:00:00.003 | +-------------------------+ select ts from prune_float_zero where v = -0.0 order by ts; +-------------------------+ | ts | +-------------------------+ | 1970-01-01T00:00:00.001 | | 1970-01-01T00:00:00.002 | +-------------------------+ select ts from prune_float_zero where v in (0.0) order by ts; +-------------------------+ | ts | +-------------------------+ | 1970-01-01T00:00:00.001 | | 1970-01-01T00:00:00.002 | +-------------------------+ drop table prune_float_zero; Affected Rows: 0