We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, tidb can't generate index merge access path for such case:
CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` varchar(30) DEFAULT NULL, `c` float DEFAULT NULL, `j` json DEFAULT NULL, `pk` int(11) NOT NULL, PRIMARY KEY (`pk`) /*T![clustered_index] CLUSTERED */, KEY `mvi1` (`c`,(cast(json_extract(`j`, _utf8'$.a') as unsigned array)),`b`), KEY `mvi2` (`a`,(cast(json_extract(`j`, _utf8'$.c') as unsigned array))), KEY `mvi3` ((cast(json_extract(`j`, _utf8'$.d') as unsigned array)),`c`), KEY `idx` (`b`,`c`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; explain format=brief select /*+ use_index_merge(t, mvi1) */ * from t where ( 1 member of (j->'$.a') or 2 member of (j->'$.a') ) and a = 20 and c = 10;
> explain format=brief select /*+ use_index_merge(t, mvi1) */ * from t where ( 1 member of (j->'$.a') or 2 member of (j->'$.a') ) and a = 20 and c = 10; +-----------------------+----------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | id | estRows | task | access object | operator info | +-----------------------+----------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | TableReader | 0.01 | root | | data:Selection | | └─Selection | 0.01 | cop[tikv] | | eq(test.t.a, 20), eq(test.t.c, 10), or(json_memberof(cast(1, json BINARY), json_extract(test.t.j, "$.a")), json_memberof(cast(2, json BINARY), json_extract(test.t.j, "$.a"))) | | └─TableFullScan | 10000.00 | cop[tikv] | table:t | keep order:false, stats:pseudo | +-----------------------+----------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 3 rows in set, 1 warning (0.004 sec)
The text was updated successfully, but these errors were encountered:
planner: code prepare for support OR list nested in AND list for mv i…
6a76187
…ndex (#51780) ref #51778
planner: support OR list nested in AND list for mv index (#51716)
af76c2f
close #51778
time-and-fate
Successfully merging a pull request may close this issue.
Enhancement
Currently, tidb can't generate index merge access path for such case:
The text was updated successfully, but these errors were encountered: