问题
How to create index on sub-documents in Json data type in MySQL server?
I know we have to create a generated column from the base table and then need to index that column Virtually or stored.
But I want syntax for creating a generated column for sub-document.
回答1:
JSON columns, like columns of other binary types, are not indexed directly; instead, you can create an index on a generated column that extracts a scalar value from the JSON column. See Section “Secondary Indexes and Generated Virtual Columns”, for a detailed example.
来源:https://stackoverflow.com/questions/38389075/how-to-create-index-on-json-column-in-mysql