mirror of
https://github.com/MariaDB/server.git
synced 2025-12-12 23:35:44 +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
|
||
|---|---|---|
| .. | ||
| mysql-test/spider | ||
| CMakeLists.txt | ||
| ha_spider.cc | ||
| ha_spider.h | ||
| spd_conn.cc | ||
| spd_conn.h | ||
| spd_copy_tables.cc | ||
| spd_copy_tables.h | ||
| spd_db_conn.cc | ||
| spd_db_conn.h | ||
| spd_db_include.cc | ||
| spd_db_include.h | ||
| spd_db_mysql.cc | ||
| spd_db_mysql.h | ||
| spd_direct_sql.cc | ||
| spd_direct_sql.h | ||
| spd_err.h | ||
| spd_group_by_handler.cc | ||
| spd_group_by_handler.h | ||
| spd_i_s.cc | ||
| spd_include.h | ||
| spd_init_query.h | ||
| spd_malloc.cc | ||
| spd_malloc.h | ||
| spd_param.cc | ||
| spd_param.h | ||
| spd_ping_table.cc | ||
| spd_ping_table.h | ||
| spd_sys_table.cc | ||
| spd_sys_table.h | ||
| spd_table.cc | ||
| spd_table.h | ||
| spd_trx.cc | ||
| spd_trx.h | ||
| spd_udf.cc | ||
| spd_udf.def | ||
| spd_udf.h | ||
| spider.cnf | ||