简体   繁体   English

MariaDB-是否可以索引JSON数组?

[英]MariaDB - is it possible to index JSON arrays?

When working with JSON in MariaDB it is possible to index single-point values using virtual columns eg 在MariaDB中使用JSON时,可以使用虚拟列为单点值编制索引,例如

ALTER TABLE features ADD feature_street VARCHAR(30) AS (JSON_UNQUOTE(feature->"$.properties.STREET"));
ALTER TABLE features ADD INDEX (feature_street);

Does anybody know whether it is possible to index JSON arrays in the same way so that when querying based on the values of the array members, each array does not have to be scanned? 是否有人知道是否可以用相同的方式索引JSON数组,以便在基于数组成员的值进行查询时不必扫描每个数组?

I can't find anything in the docs which suggests this is possible. 我在文档中找不到任何提示这是可能的。

Create a "virtual" column of the element of the JSON column and index it. 在JSON列的元素中创建一个“虚拟”列,并为其建立索引。

https://mariadb.com/kb/en/mariadb/virtual-computed-columns/ https://mariadb.com/kb/zh-CN/mariadb/virtual-computed-columns/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM