mariadb/storage/spider
Yuchen Pei 7d7d552b03
MDEV-37330 Allow unordered index scan for tables partitioned by range when a priority queue is not needed
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
2025-11-21 14:49:39 +11:00
..
mysql-test/spider MDEV-37330 Allow unordered index scan for tables partitioned by range when a priority queue is not needed 2025-11-21 14:49:39 +11:00
CMakeLists.txt Fix broken clang-cl compilation 2025-04-04 08:58:40 +02:00
ha_spider.cc MDEV-28363 remove #ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor 2025-10-17 15:03:21 +11:00
ha_spider.h MDEV-27474 Spider: remove #WITH_PARTITION_STORAGE_ENGINE 2025-07-14 11:23:51 +10:00
spd_conn.cc MDEV-27474 Spider: remove #WITH_PARTITION_STORAGE_ENGINE 2025-07-14 11:23:51 +10:00
spd_conn.h Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00
spd_copy_tables.cc MDEV-27474 Spider: remove #WITH_PARTITION_STORAGE_ENGINE 2025-07-14 11:23:51 +10:00
spd_copy_tables.h MDEV-27642 Spider: remove #ifdef WITHOUT_SPIDER_BG_SEARCH 2022-02-10 14:58:26 +09:00
spd_db_conn.cc MDEV-28363 remove #ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor 2025-10-17 15:03:21 +11:00
spd_db_conn.h Merge branch '10.5' into 10.6 2025-01-29 11:17:38 +01:00
spd_db_include.cc Merge branch '10.6' into 10.11 2024-09-11 16:10:53 +10:00
spd_db_include.h Merge branch '11.8' into 12.0 2025-07-31 20:55:47 +02:00
spd_db_mysql.cc MDEV-28363 remove #ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor 2025-10-17 15:03:21 +11:00
spd_db_mysql.h Merge branch '10.11' into 11.4 2025-07-28 19:40:10 +02:00
spd_direct_sql.cc Merge 10.11 into 11.4 2025-03-28 13:55:21 +02:00
spd_direct_sql.h MDEV-27642 Spider: remove #ifdef WITHOUT_SPIDER_BG_SEARCH 2022-02-10 14:58:26 +09:00
spd_err.h MDEV-32627 Spider: use CONNECTION string in SQLDriverConnect 2024-08-28 16:43:07 +10:00
spd_group_by_handler.cc MDEV-27474 Spider: remove #WITH_PARTITION_STORAGE_ENGINE 2025-07-14 11:23:51 +10:00
spd_group_by_handler.h Merge branch '10.6' into 10.11 2024-10-29 15:24:38 +01:00
spd_i_s.cc Merge branch '10.6' into 10.11 2024-09-11 16:10:53 +10:00
spd_include.h MDEV-28363 remove #ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor 2025-10-17 15:03:21 +11:00
spd_init_query.h Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00
spd_malloc.cc Merge branch '11.2' into 11.4 2024-09-18 11:27:53 +10:00
spd_malloc.h MDEV-20179 Server hangs on shutdown during installation of Spider (#1368) 2019-07-30 06:16:48 +09:00
spd_param.cc MDEV-27474 Spider: remove #WITH_PARTITION_STORAGE_ENGINE 2025-07-14 11:23:51 +10:00
spd_param.h MDEV-27474 Spider: remove #WITH_PARTITION_STORAGE_ENGINE 2025-07-14 11:23:51 +10:00
spd_ping_table.cc MDEV-27474 Spider: remove #WITH_PARTITION_STORAGE_ENGINE 2025-07-14 11:23:51 +10:00
spd_ping_table.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
spd_sys_table.cc MDEV-28363 remove #ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor 2025-10-17 15:03:21 +11:00
spd_sys_table.h MDEV-28363 remove #ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor 2025-10-17 15:03:21 +11:00
spd_table.cc Merge 11.4 into 11.8 2025-09-29 18:25:09 +03:00
spd_table.h Merge branch '10.11' into 11.4 2025-07-28 19:40:10 +02:00
spd_trx.cc Merge branch '11.4' into bb-11.8-release 2025-10-24 12:25:01 +02:00
spd_trx.h Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
spd_udf.cc Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00
spd_udf.def
spd_udf.h Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00
spider.cnf Unify config syntax in default files 2020-08-01 10:31:41 +10:00