您好,登錄后才能下訂單哦!
MySQL中怎么利用pt-duplicate-key-checker找出冗余、重復(fù)索引,相信很多沒(méi)有經(jīng)驗(yàn)的人對(duì)此束手無(wú)策,為此本文總結(jié)了問(wèn)題出現(xiàn)的原因和解決方法,通過(guò)這篇文章希望你能解決這個(gè)問(wèn)題。
解壓pt軟件
# tar xfz percona-toolkit-3.0.2_x86_64.tar.gz
安裝對(duì)應(yīng)的perl依賴包
# yum install perl-DBI
# yum install perl-DBD-MySQL
執(zhí)行pt-duplicate-key-checker命令
# ./bin/pt-duplicate-key-checker -uroot -pcnstrong#123454321 -S /data/mysql01/mysql.sock
# ########################################################################
# beike.ls_lesson
# ########################################################################
# index_lesson_classSubjId is a left-prefix of index_lesson_classSubjId_startTime
# Key definitions:
# KEY `index_lesson_classSubjId` (`classSubjId`),
# KEY `index_lesson_classSubjId_startTime` (`classSubjId`,`startTime`)
# Column types:
# `classsubjid` bigint(20) default null comment '????id'
# `starttime` timestamp null default null comment '????'
# To remove this duplicate index, execute:
ALTER TABLE `beike`.`ls_lesson` DROP INDEX `index_lesson_classSubjId`;
# ########################################################################
# course.QRTZ_BLOB_TRIGGERS
# ########################################################################
# SCHED_NAME is a duplicate of PRIMARY
# Key definitions:
# KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
# PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
# Column types:
# `sched_name` varchar(120) not null
# `trigger_name` varchar(200) not null
# `trigger_group` varchar(200) not null
# To remove this duplicate index, execute:
ALTER TABLE `course`.`QRTZ_BLOB_TRIGGERS` DROP INDEX `SCHED_NAME`;
# ########################################################################
# course.QRTZ_FIRED_TRIGGERS
# ########################################################################
# IDX_QRTZ_FT_TRIG_INST_NAME is a left-prefix of IDX_QRTZ_FT_INST_JOB_REQ_RCVRY
# Key definitions:
# KEY `IDX_QRTZ_FT_TRIG_INST_NAME` (`SCHED_NAME`,`INSTANCE_NAME`),
# KEY `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`),
# Column types:
# `sched_name` varchar(120) not null
# `instance_name` varchar(200) not null
# `requests_recovery` varchar(1) default null
# To remove this duplicate index, execute:
ALTER TABLE `course`.`QRTZ_FIRED_TRIGGERS` DROP INDEX `IDX_QRTZ_FT_TRIG_INST_NAME`;
看完上述內(nèi)容,你們掌握MySQL中怎么利用pt-duplicate-key-checker找出冗余、重復(fù)索引的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。