Files
greptimedb/src/mito2
dennis zhuang 2effff48d5 perf(mito2): prune files by their primary key range before reading footers (#10564)
* perf(mito2): prune files by their primary key range before reading footers

File-level pruning used only the manifest time range, so a scan read the footer of every file in the time range even when the file's primary key range excludes the predicate. The file-level pruning statistics now include the min and max of the first primary key column, decoded from FileMeta's primary key range, so such files are skipped without a footer read. For metric engine physical regions the first column is the table id.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* test(mito2): cover file pruning by primary key range end to end

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* perf(mito2): decode the file primary key range only when pruning uses it

Predicates on the time index or fields never ask for the first primary
key column, so they no longer build a codec and two arrays per file.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito2): prune files by primary key ranges loaded from footers

Region open can fill a file handle's key range from the SST footer when
the manifest has none. Let the handle decide whether bounds are known,
so those files are pruned too.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* test: check file pruning by primary key range with EXPLAIN ANALYZE

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-11-23 08:04:54 +00:00
..

Mito

Mito is GreptimeDB's default region engine.

About Mito

The Alfa Romeo MiTo is a front-wheel drive, three-door supermini designed by Centro Stile Alfa Romeo.

"You can't be a true petrolhead until you've owned an Alfa Romeo."

-- by Jeremy Clarkson

Benchmarks

Run benchmarks in this crate:

cargo bench -p mito2 -F test