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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:57:50+00:00 2026-05-30T00:57:50+00:00

I have like 10 table inserts and each insert has 1 either 1000 or

  • 0

I have like 10 table inserts and each insert has 1 either 1000 or even 1 lakh records
and have got 4 table updates as well. Basically for 1 lakh records, it would be 10 lakh inserts and 4 lakh updates and this could run on an hourly basis. And the main constraint is that the whole 10 table inserts and 4 table updates has to be in one transaction.

I read about several ways.For handling updates I might go with using a temporary table and and dump all the IDs which has to be updated to the table and then using a join with that temporary table from the REAL table to which the update has to be done. But I still dont have an effective solution for bulk inserting into 10 tables. It is eating up lot of time. LOAD_DATA file is an option, but that might not be a good choice provided in realtime I might end up creating 100s of thousands of files as this operation will happen across many databases and scopes. Please give your suggestions to increase the speed for these bulk inserts.

I am planning to change “bulk_insert_buffer_size” in mysql and any other parameters that would be useful as well. So any kind of suggestion would help me a lot here

  • 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-30T00:57:52+00:00Added an answer on May 30, 2026 at 12:57 am

    How are you trying to do these bulk inserts? Are you using some client GUI like phpMyAdmin? Please try to run the SQL on the MySQL client prompt.

    abhay> mysql -u<your_user> -h<your_host> -p < <path_to_your_sql_file> 
    

    This should be fast enough to do all INSERT and UPDATES. Please do remember to put actual values where applicable. And the SQL file should contain valid INSERT and UPDATE statements.

    Few suggestions:

    1. you might try adding SET foreign_key_checks = 0 at the beginning of your SQL file and SET foreign_key_checks = 1 at the end
    2. if your tables have many indexes, temporarily disabling them might help. Try ALTER TABLE...DISABLE KEYS and ALTER TABLE...ENABLE KEYS
    3. You may even choose to split into multiple SQL files, one per table

    Hope it helps!

    • 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 3 columns. Each has a unique index. I'd like
I have a multi-row insert that looks something like: insert into table VALUES (1,
I have created a test table in MySQL and would like to insert 10
I have a table containing a large number of rows. Each row has 2
Ok so say I have 100 rows to insert and each row has about
I have a database table where each row (movie) has a couple of numeric
I have a table containing a large number of rows. Each row has 2
I have a table like this: Application,Program,UsedObject It can have data like this: A,P1,ZZ
Imagine I have table like this: id:Product:shop_id 1:Basketball:41 2:Football:41 3:Rocket:45 4:Car:86 5:Plane:86 Now, this
I have a table like as follows: SoftwareName Count Country Project 15 Canada Visio

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.