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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:34:23+00:00 2026-05-20T23:34:23+00:00

I have a table that gets updated very regularly throughout the day, so Im

  • 0

I have a table that gets updated very regularly throughout the day, so Im looking for the most scalable method for updating rows. These updates happen in large batches, so each update may include around 1000 rows.

Currently, I’m looping through each of these 1000 rows and running a single update query… while it doesn’t take long to execute, it just seems wasteful compared to one simple mass insert statement. So REPLACE INTO makes sense, since its basically deleting the old rows and inserting new ones, but how does that compare to a manual “delete where id in array” then mass insert? Exact same? Slightly different? Is there a better method?

The key here is that these aren’t single row queries but mass row queries. So the question is, what is the most scalable way to run these updates. I say “scalable” and not “fastest” because these updates happen at regular intervals on a production server with active users, so speed is important but not at the cost of locking up the server.

  • 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-20T23:34:24+00:00Added an answer on May 20, 2026 at 11:34 pm

    You want to use InnoDB for this instead of MyISAM. Why? Because when you’re performing bulk inserts and deletes, wrapping the entire thing in a transaction can be a huge performance boost.

    No matter what you end up doing to the data, that change alone could be huge.

    With an appropriate transaction isolation level, your users could continue using the table while you change everything about it, only seeing the changes once you commit, without worry about table locks.

    With regard to the actual data update, avoid deletes. Deletes are slow. Do updates, and delete only things you need to update. Avoid the REPLACE INTO magic as well, as it does a delete before an insert.

    • 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 AIS marine data that gets updated very often. What
I have a table (InnoDB) that gets inserted, updated and read frequently (usually in
I have a table that gets updated from an outside source. It normally sits
I have multiple buttons that gets created in a table which all look like
I have an Excel file that gets external data from database table. I need
For example I have a dropdown box that gets a town from the table
I have a self referencing table in Oracle 9i, and a view that gets
I have those code snippet that checks the fans table and gets everyone who
We have a database that gets updated everyday at midnight with a cronjob, we
I have a report that gets updated every week that needs pushed out to

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.