Mwkk
(Ti D Ber A Cla Yr Lb)
1
【 TiDB 使用环境】生产环境 /测试/ Poc
【 TiDB 版本】v7.1.4
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】
对一个37行的表添加一个唯一索引,一直处于running 状态,表结构为
CREATE TABLE wechat_video_channels_account
(
id
bigint(0) NOT NULL AUTO_INCREMENT COMMENT ‘自增id’,
account_id
varchar(255) NOT NULL COMMENT ‘账号在视频号的唯一id’,
account_name
varchar(255) NOT NULL COMMENT ‘账号名称’,
update_time
datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT ‘更新时间’,
create_time
datetime NOT NULL COMMENT ‘创建时间’,
PRIMARY KEY (id
) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=90001;
添加索引语句为 ALTER TABLE lego_star_test
.wechat_video_channels_account
ADD UNIQUE INDEX accountid_uidx
(account_id
);
zhanggame1
(Ti D Ber G I13ecx U)
2
先看看select * from tidb_mdl_view;表有数据没
另外数据量多大
数据很小,加索引很慢,那就是有有特殊操作,比如引起锁。
Mwkk
(Ti D Ber A Cla Yr Lb)
7
[2024/05/29 18:51:18.585 +08:00] [INFO] [index.go:620] [“[ddl] run add index job”] [job=“ID:9923, Type:add index, State:running, SchemaState:none, SchemaID:192, TableID:9875, RowCount:0, ArgLen:6, start time: 2024-05-29 18:40:33.992 +0800 CST, Err:[ddl:-1][Lightning:PD:ErrCreatePDClient]create pd client error: [pd] unmatched cluster id, ErrCount:151, SnapshotVersion:0, UniqueWarnings:0”] [indexInfo=“{"id":4,"idx_name":{"O":"accountid_uidx","L":"accountid_uidx"},"tbl_name":{"O":"","L":""},"idx_cols":[{"name":{"O":"account_id","L":"account_id"},"offset":1,"length":-1}],"state":0,"backfill_state":0,"comment":"","index_type":1,"is_unique":true,"is_primary":false,"is_invisible":false,"is_global":false,"mv_index":false}”]
stokcli
(Stockli)
10
Region leader节点压力大,也可能会影响DDL的执行速度。