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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:53:39+00:00 2026-06-07T18:53:39+00:00

I have a table, which is accessed by multiple worker applications, which grab a

  • 0

I have a table, which is accessed by multiple worker applications, which grab a batch of records, calculate some stuff on them and update the calculated result back into this table. This table is currently MyISAM based, but since we had some changes to our calculating algorithm and it resulted in a huge speed up, we have seen loads of locks on the table, which is expected as it’s a MyISAM table. (The table has around 650-700 000 records in it).

Once all the records are processed, a report is generated based on it and the table is truncated. Once the table is truncated, a processes reinitalizeses it and the cycle starts again.

I was thinking about switching over the MyISAM table to InnoDB to prevent locks, but the processes, which initalizes the table with a INSERT INTO .. SELECT .. FROM statement (which used to take 3-4 mintues), was running for 35-40 minutes when i decided to stop it. Why is this? Is there a way to speed it up?

  • 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-07T18:53:40+00:00Added an answer on June 7, 2026 at 6:53 pm

    MyISAM stores records in the order they’re inserted. On the other hand, InnoDB’s primary key is a clustered index, so records are physically stored in the same order as the primary key. Therefore, ensure you’re inserting in primary key order. You can add an ORDER BY clause to the INSERT INTO … SELECT.

    Also, to avoid split pages and rebuilding of your secondary indexes, add your secondary indexes after you’ve inserted the initial rows. So, remove the indexes, then re-add them after.

    Also, to avoid the row locking (and auto-increment locking) overhead, explicitly lock the tables with LOCK TABLES.

    Finally, increase innodb_buffer_pool_size, otherwise your indexes will build very slowly. The default is only 8MB.

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

Sidebar

Related Questions

I have a ##table which can be accessed across all the sessions but sometimes
I have table which contains double values stored in mysql database ...I need to
I have table in which I am inserting rows for employee but next time
i have a table which has many fields but i want to get count
I have a table which i want to store all the outputs into one
I have one table which contains events and dates, and another which contains the
I have a table which stores the data related to posts in this format
I have a table which contains TV Guide data. In a simplified form, the
I have a table which is dynamically created based on the amount of results
I have a table which consists of a few columns, including a Key Value

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.