mirror of
https://github.com/MariaDB/server.git
synced 2025-11-26 23:49:43 +01:00
There are two types of partition index scans. Ordered and unordered.
The ordered scan utilises a priority queue of size equal to the number
of partitions. Thus when the number of partitions is large and a
SELECT query with ORDER BY request only a few results (e.g. LIMIT 1),
populating the partitions can be wasteful. Therefore in this patch we
allow the use of unordered scan when a priority queue is not needed.
This includes:
Case 1. The PARTITION BY RANGE expression is a col that is a prefix of
the active index and we are in
index_first/index_last/index_read_map/read_range_first/multi_range_read_next,
OR
Case 2. The PARTITION BY RANGE expression is col1 and the active
index is (prefix_cols, col1, ...), and we are in
index_read_map(prefix_cols=prefix_value), or
read_range_first(start_key= {prefix_value, ...},
end_key={prefix_value, ...}), or
multi_range_read_next(start_key= {prefix_value, ...},
end_key={prefix_value, ...})
Limitation: not supporting reverse index
test passed with:
mtrdefault --suite main --do-test=.*partition
mtrdefault --suite parts
|
||
|---|---|---|
| .. | ||
| inc | ||
| r | ||
| t | ||
| disabled.def | ||