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

  • Home
  • SEARCH
  • 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 8951983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:46:24+00:00 2026-06-15T13:46:24+00:00

I have a table with 17.6m rows ‘CREATE TABLE `tmp_hist` ( `ti` int(11) DEFAULT

  • 0

I have a table with 17.6m rows

'CREATE TABLE `tmp_hist` (
`ti` int(11) DEFAULT NULL,
`cip6` varchar(15) DEFAULT NULL,
`date` varchar(20) DEFAULT NULL,
`fact` int(11) DEFAULT NULL,
`se` char(1) DEFAULT NULL,
`oper` int(11) DEFAULT NULL,
`qte` int(11) DEFAULT NULL,
`prix` double DEFAULT NULL,
`cip` int(11) DEFAULT NULL,
`fl` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1'

And it takes around 10 minutes to run a very simple update

update tmp_hist set cip=100

There’re the times:

  • 39sec — repair table tmp_hist (this one is particularly interesting because in myisam, repairing a table copies it to a different file and replaces original, this indicates disk speed)
  • 531sec — update tmp_hist set cip=100
  • 400sec — CREATE TABLE tmp_inno SELECT * FROM tmp_hist (here I try to convert the table to InnoDB)
  • 317sec — update tmp_inno set cip=999 (this one in InnoDb)

By all assumptions I expect the update time to be very comparable to repair time, that is, 40 seconds. But it takes 10 minutes! What can be done to speed it up? The code in question converts some data from format A to format B. It is guaranteed to run in a single thread without anyone else ever accessing same data and no recovery will be needed should anything go wrong, it can be just started over.

PS: The UPDATE statement is simplified for testing (and all times are for this simplified update). The real code sets different values for each row, but I found that the execution time for real update is almost the same as for simplified update, so i narrowed the problem to simplified one.

Current progress

Using the knowledge from the answer, I applied ROW_FORMAT=FIXED (which appears to be equivalent to changing all column types to fixed) and it reduced the update time to 145sec, which is almost 4 times faster.

Still, it’s around 2.5x slower then repair time, which I deem to be the time that can be reached.

  • 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-15T13:46:25+00:00Added an answer on June 15, 2026 at 1:46 pm

    Since you have varchars in your table, the update must read the row, look for the correct offset and then update the cip field. Furthermore, since the rows are variable sized, the engine cannot easily determine offsets of a single record. So, you might try changing your varchar fields to fixed char and test, if this makes a difference.

    An interesting answer, covering this topic too, is over at dba SE https://dba.stackexchange.com/a/2643

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

Sidebar

Related Questions

I have table of 5000+ rows and 8+ columns like, Station Lat Long Date
how remove html table rows after 2nd row? if in table have 5 row,
I have table INCIDENT with rows TICKETID ACTUALFINISH TARGETFINISH 100 2012-03-01 11:11:11 2012-02-01 11:11:11
I have table with few rows, after use hover mouse over row I want
I have a table with rows of quotes (ID, QUOTE) and I have a
I have a table with rows of height 90. I want to have an
I have a table with rows of alternating colors, e.g.: <table> <tr class=even><td></td><td></td></tr> <tr
On my pages I have a table with rows that typically look like this:
I have table with around 70 000 rows. There is 6000 rows that i
I have table in which I am inserting rows for employee but next time

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.