You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there will be no index filters for mv index paths. All filters will be put on the TableRowIDScan.
createtablet (a int, b varchar(30), c float, j json, pk intprimary key,key mvi1(c, (cast(j->'$.a'as unsigned array)), b),key mvi2(a, (cast(j->'$.c'as unsigned array))),key mvi3((cast(j->'$.d'as unsigned array)), c),key idx(b, c));
EXPLAIN format = brief SELECT/*+ use_index_merge(t, mvi1) */*from t where c =1and json_overlaps(j->'$.a', '[4,5,6]') and b not like'%test%';
> EXPLAIN format = brief SELECT /*+ use_index_merge(t, mvi1) */ * from t where
-> c = 1 and
-> json_overlaps(j->'$.a', '[4,5,6]') and
-> b not like '%test%';
+-------------------------------+---------+-----------+----------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+-------------------------------+---------+-----------+----------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| Selection | 0.24 | root | | json_overlaps(json_extract(test.t.j, "$.a"), cast("[4,5,6]", json BINARY)) |
| └─IndexMerge | 0.30 | root | | type: union |
| ├─IndexRangeScan(Build) | 0.10 | cop[tikv] | table:t, index:mvi1(c, cast(json_extract(`j`, _utf8'$.a') as unsigned array), b) | range:[1 4,1 4], keep order:false, stats:pseudo |
| ├─IndexRangeScan(Build) | 0.10 | cop[tikv] | table:t, index:mvi1(c, cast(json_extract(`j`, _utf8'$.a') as unsigned array), b) | range:[1 5,1 5], keep order:false, stats:pseudo |
| ├─IndexRangeScan(Build) | 0.10 | cop[tikv] | table:t, index:mvi1(c, cast(json_extract(`j`, _utf8'$.a') as unsigned array), b) | range:[1 6,1 6], keep order:false, stats:pseudo |
| └─Selection(Probe) | 0.30 | cop[tikv] | | not(like(test.t.b, "%test%", 92)) |
| └─TableRowIDScan | 0.30 | cop[tikv] | table:t | keep order:false, stats:pseudo |
+-------------------------------+---------+-----------+----------------------------------------------------------------------------------+----------------------------------------------------------------------------+
7 rows in set, 1 warning (0.006 sec)
The text was updated successfully, but these errors were encountered:
Enhancement
Currently, there will be no index filters for mv index paths. All filters will be put on the
TableRowIDScan
.The text was updated successfully, but these errors were encountered: