标签:char extra drop mysql操作 big highlight from dex json
CREATE TABLE IF NOT EXISTS table_json (id BIGINT auto_increment,json JSON,PRIMARY KEY(id)); ALTER TABLE table_json add COLUMN name VARCHAR(128) GENERATED ALWAYS AS (JSON_EXTRACT(json, "$.name")) virtual; ALTER TABLE table_json add COLUMN name VARCHAR(128) GENERATED ALWAYS AS (JSON_EXTRACT(json, "$.name")) stored; ALTER TABLE table_json ADD FULLTEXT INDEX idx_fulltext_name(name_store) ALTER TABLE table_json ADD INDEX name(name); ALTER TABLE table_json DROP INDEX name; CREATE TABLE IF NOT EXISTS table_json (id BIGINT auto_increment,json JSON,name VARCHAR(128) GENERATED ALWAYS AS (json->"$.name") virtual,PRIMARY KEY(id),INDEX name_index(name)); SELECT JSON_EXTRACT(json, "$.name") from table_json; SELECT name FROM table_json;
标签:char extra drop mysql操作 big highlight from dex json
原文地址:https://www.cnblogs.com/shiying/p/9567216.html