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 6369527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:49:01+00:00 2026-05-25T00:49:01+00:00

I have a 9 million rows table and I’m struggling to handle all this

  • 0

I have a 9 million rows table and I’m struggling to handle all this data because of its sheer size.

What I want to do is add IMPORT a CSV to the table without overwriting data.

Before I would of done something like this; INSERT if not in(select email from tblName where source = “number” and email != “email”) INTO (email…) VALUES (“email”…)

But I’m worried that I’ll crash the server again. I want to be able to insert 10,000s of rows into a table but only if its not in the table with source = “number”.

Otherwise I would of used unique on the email column.

In short, I want to INSERT as quickly as possible without introducing duplicates to the table by checking two things. If email != “email” AND source != “number” then insert into table otherwise do nothing. And I dont want errors reports either.

I’m sorry for my bad wording and the question sounding a little silly.

I’m just having a hard time adabting to not been able to test it out on the data by downloading backups and uploading if it goes wrong. I hate large datasets 🙂

Thank-you all for your time
-BigThings

  • 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-05-25T00:49:01+00:00Added an answer on May 25, 2026 at 12:49 am

    Set a UNIQUE constraint on email and source columns.

    Then do:

    INSERT INTO table_name(email, source, ...) VALUES ('email', 'source', ...)
    ON DUPLICATE KEY UPDATE email = email;
    

    INSERT IGNORE will not notify you of any kind of error. I would not recommend it. Neither would I recommend INSERT ... WHERE NOT IN. MySQL has an already well optimized functionality for that. That’s why INSERT ... ON DUPLICATE KEY UPDATE is there.

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

Sidebar

Related Questions

I have a table with around 40 million rows, and I want to run
I have a table that contains approx 10 million rows. This table is periodically
I have a table which has around 1 million rows (size on physical disk
I have an ORACLE table with a few million rows of data. One of
I have 1 million rows in MySql table temp and wish to multiply column
I have a table with 1.5 million rows. I run a query which fetches
I have a table with ~200 million rows and ~15 columns in it. I
I have a table containing 60 million rows. The structure is like entryid, date,
We have a large table (450 million rows containing 34 columns of numeric or
I have a items table with 1 million rows and a users table with

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.