Log index tuning
logs_v1 carries skip indexes so free-text search reads few granules.
Index | Expression | Serves |
|---|---|---|
|
| single-token search: |
|
| substring search (terms of 4+ characters) |
|
| attribute filters |
|
| trace id lookups |
Search terms that are one alphanumeric token compile to hasToken(lower(body), lower(term)); anything else becomes position(lower(body), lower(term)) > 0. The indexed expression must match exactly, so keep the lower(...) wrapper in custom queries.
Old data
New parts carry the indexes. The janitor job index_materialize builds them on older parts, one partition per tick, oldest first, skipping the newest 2 partitions, one MATERIALIZE INDEX at a time. It is safe to run repeatedly: a partition whose parts all have index marks is not touched.
Merge policy
wt_store_ch::settings::LOGS_PROFILE sets min_age_to_force_merge_seconds = 3600 and a max_bytes_to_merge_at_max_space_in_pool cap through ALTER TABLE logs_v1 MODIFY SETTING. Only settings that differ are altered, so applying twice is a no-op. Verify index use with EXPLAIN indexes = 1.