[MySQL Help] A friend asked: how to quickly repeat data in an Innodb table with million records

Source: Internet
Author: User

My friend asked:
50 million how to deduplicate a table with data and determine whether the table is repeated based on the two fields.
 
 
 
Reply:
Select two fields and the primary key id to create a temporary table t1,
T1 is used to establish a primary key index and a joint index of two comparative fields.
Then compare duplicate records in the temporary table,
Record the duplicate data to the second temporary table t2. The structure of table t2 is exactly the same as that of table t1.
Then, you can decide how to process the repeated records in Table t2 based on your business, and associate table t2 with the original million records for processing,
Generally, the group by2 field is used to retrieve records with a large primary key id and delete them.

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.