Details
-
New Feature
-
Status: Open (View Workflow)
-
Critical
-
Resolution: Unresolved
-
Q3/2026 Server Development
Description
After MDEV-25848 implements multi-value indexes, the optimizer could use those to perform efficient searches for JSON data.
This will achieve either or both of the goals:
Goal 1: index do searches like in MySQL:
create index idx1 on t1 ((cast(a->'$.arr' as unsigned array))); |
explain select * from t101 where 4 member of (a->'$.arr'); |
Without MDEV-13594 (support for '->' syntax), an alternative would be using JSON_EXTRACT:
create index idx1 on t1 ((cast (json_extract(a, '$.arr') as unsigned array))); |
but ultimately it depends on what MDEV-25848 implements.
Note: in MySQL, there is no UNSIGNED ARRAY datatype. The CAST ... AS UNSIGNED ARRAY syntax is only accepted in index definitions. Attempt to use it somewhere else gives this error:
ERROR 1235 (42000): This version of MySQL doesn't yet support 'Use of CAST( .. AS ..
|
ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in
|
general expressions'
|
Goal 2: Support index lookups for generic JSON predicates like
JSON_VALUE(js_column, '$.attribute_name') = 'value' |
WHERE column->json_attr = 'foo';
The scope of this task.
MDEV-25848 be implemented before this task. It will add Multi-Value Index support for New Fulltext and vector indexes.
It will NOT do anything for JSON.
The scope of this task is everything else needed to get the above JSON use cases running.
- Adjust CREATE TABLE to support new index definitions.
- Produce index entries for a table row.
- Detect relevant expressions in the WHERE clause and construct Access Methods for them
- ...
Attachments
Issue Links
- is blocked by
-
MDEV-25848 Support for Multi-Valued Indexes
-
- In Progress
-
- relates to
-
MDEV-13594 Support for JSON operators column->path and column->>path
-
- In Testing
-
-
MDEV-35389 Native Multi-Value Indexes for JSON
-
- Open
-
-
MDEV-37288 JSON Comparator: does MariaDB need one?
-
- Closed
-
-
MDEV-40113 Optimizer support for Multi-Valued indexes: support new Full Text Search
-
- Open
-