Does TiDB support creating indexes on JSON types?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TIDB 支持json类型创建索引吗

| username: TiDBer_KUR3fjyg

Does TiDB support creating indexes on JSON types, such as the syntax index idx_b((CAST(b as CHAR(32) ARRAY)))?

| username: ShawnYan | Original post link

Please refer to JSON 类型 | PingCAP 文档中心

| username: TiDBer_KUR3fjyg | Original post link

It seems not, MySQL 8 supports this syntax.

| username: zhanggame1 | Original post link

You can take a look at generated columns
Generated Columns | PingCAP Documentation Center

| username: forever | Original post link

7.1 and above are supported.

| username: tidb菜鸟一只 | Original post link

Generated columns can meet your needs.

| username: TiDBer_KUR3fjyg | Original post link

Thank you very much.

| username: dba远航 | Original post link

Supported in versions 7.1 and above.

| username: 哈喽沃德 | Original post link

Correct!

| username: 双开门变频冰箱 | Original post link

Supported in version 7.1 and above.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.