30.2 How To Tell Whether a Function-Based Index for JSON Data Is Picked Up

Whether or not a particular index is picked up for a given query is determined by the optimizer. To determine whether a given query picks up a given function-based index, look for the index name in the execution plan for the query.

For example:

When a multivalue index is picked up, the execution plan also shows (MULTI VALUE) for the index range scan, and the filter used in the plan is JSON_QUERY, not JSON_EXISTS2. If the execution plan does not use a multivalue index for a given json_exists query, then the filter is JSON_EXISTS2.