Mysql checks duplicate indexes and mysql checks indexes.

Source: Internet
Author: User

Mysql checks duplicate indexes and mysql checks indexes.

Mysql can re-create an index on the same field, but oracle cannot. Installation requiredPt-query-digest.

[Root @ VM-10 ~] #Pt-duplicate-key-checker-h10.10.11.208-uroot-proot-P3316 -- charset = gbk

######################################## #################################
# Test. app_chat_message
######################################## #################################
# Idx_app_chat_message_to_user_from_user is a left-prefix of Index 3
# Key definitions:
# KEY 'idx _ app_chat_message_to_user_from_user '('to _ user', 'From _ user '),
# KEY 'index 3' ('to _ user', 'From _ user', 'message _ id '),
# Column types:
# 'To _ user' varchar (50) not null default''
# 'From _ user' varchar (50) not null default''
# 'Message _ id' varchar (40) not null default''
# To remove this duplicate index, execute:

Alter table 'test'. 'app _ chat_message 'drop Index' idx _ app_chat_message_to_user_from_user ';


# Index 2 is a left-prefix of Index 3
# Key definitions:
# KEY 'index 2' ('to _ user', 'From _ user '),
# KEY 'index 3' ('to _ user', 'From _ user', 'message _ id '),
# Column types:
# 'To _ user' varchar (50) not null default''
# 'From _ user' varchar (50) not null default''
# 'Message _ id' varchar (40) not null default''
# To remove this duplicate index, execute:
Alter table 'test'. 'app _ chat_message 'drop index 'index 2 ';
######################################## #################################
# Test. pub_user
######################################## #################################
# Phone is a duplicate of phone_idx
# Key definitions:
# KEY 'phone' ('phone '),
# KEY 'phone _ idx' ('phone '),
# Column types:
# 'Phone' varchar (15) collate utf8_bin default null
# To remove this duplicate index, execute:
Alter table 'test'. 'pub _ user' drop index 'phone ';

# Email is a duplicate of email_idx
# Key definitions:
# KEY 'email '('email '),
# KEY 'email _ idx' ('email '),
# Column types:
# 'Email 'varchar (50) collate utf8_bin default null
# To remove this duplicate index, execute:
Alter table 'test'. 'pub _ user' drop index 'mail ';

# Account is a duplicate of account_idx
# Key definitions:
# KEY 'account' ('account '),
# KEY 'account _ idx' ('account '),
# Column types:
# 'Account' varchar (50) collate utf8_bin default null
# To remove this duplicate index, execute:
Alter table 'test'. 'pub _ user' drop index 'account ';
######################################## #################################
........................................ .................................
........................................ .................................
# Size Duplicate indextes 20358902596
# Total Duplicate Indexes 17
# Total Indexes 664

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.