Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8636479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:14:19+00:00 2026-06-12T10:14:19+00:00

Hi I have a huge unnormalized mysql database with (~100 million) urls (~20% dupes)

  • 0

Hi I have a huge unnormalized mysql database with (~100 million) urls (~20% dupes) divided into identical split tables of 13 million rows each.

I want to move the urls into a normalized database on the same mySql server.

The old database table is unnormalized, and the url’s have no index
It look like this:

entry{id,data,data2, data3, data4, possition,rang,url}

And i’m goin to slit it up into multiple tables.

url{id,url}
data{id,data}
data1{id,data}
etc

The first thing I did was

INSERT IGNORE INTO newDatabase.url (url)
SELECT DISTINCT unNormalised.url FROM oldDatabase.unNormalised

But the ” SELECT DISTINCT unNormalised.url” (13 million rows) took ages, and I figured that that since “INSERT IGNORE INTO” also do a comparison, it would be fast to just do a

INSERT IGNORE INTO newDatabase.url (url)
SELECT unNormalised.url FROM oldDatabase.unNormalised

Without the DISTINCT, is this assumption Wrong?

Any way it still takes forever and i need some help, is there a better way of dealing withe this huge quantity of unnormalized data?
Whould it be best if i did a SELECT DISTINCT unNormalised.url” on the entire 100 milion row database, and exported all the id’s, and then moved only those id’s to the new database with lets say a php script?

All ideas are welcomed, i have no clue how to port all this date without it taking a year!

ps it is hosted on a rds amazon server.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:14:20+00:00Added an answer on June 12, 2026 at 10:14 am

    As the MySQL Manual states that LOAD DATA INFILE is quicker than INSERT, the fastest way to load your data would be:

    LOCK TABLES url WRITE;
    ALTER TABLE url DISABLE KEYS;
    LOAD DATA INFILE 'urls.txt'
        IGNORE
        INTO TABLE url
        ...;
    ALTER TABLE url ENABLE KEYS;
    UNLOCK TABLES;
    

    But since you already have the data loaded into MySQL, but just need to normalize it, you might try:

    LOCK TABLES url WRITE;
    ALTER TABLE url DISABLE KEYS;
    INSERT IGNORE INTO url (url)
        SELECT url FROM oldDatabase.unNormalised;
    ALTER TABLE url ENABLE KEYS;
    UNLOCK TABLES;
    

    My guess is that INSERT IGNORE ... SELECT will be faster than INSERT IGNORE ... SELECT DISTINCT but that’s just a guess.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im getting back into database design and i realize that I have huge gaps
I have huge routes.rb file and I want to split into multiple manageable files.
i am running into a problem, i have huge database and now i cant
I have huge amount of data from database, i need to get or store
I have huge tables ( 3 millions records ) that must have a joined
I have huge table with 1 million records, i would like to modify some
I have huge dictionaries that I manipulate. More than 10 Million words are hashed.
I have huge file (17 million lines) that contains content in this format: AB101XG,57.144165160000000|,-2.114847768000000|;
I have huge dataframe like this: SN = c(1:100, 1:100, 1:100, 1:100) class =
I have huge number of Word files I need to merge (join) into one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.