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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:23:43+00:00 2026-05-31T15:23:43+00:00

I have a table in my database with around 5m records, and I’m noticing

  • 0

I have a table in my database with around 5m records, and I’m noticing the IDs of the each records are not incrementing by one any every insert.

For example, I have the following schema setup:

my_table
activity_id INT(11) PRIMARY (AUTO_INCREMENT), created_at DATETIME

If I look at the table and sort by the DATE TIME, the numbers are not sequential. It actually seems like MySQL is looking for when there is a deletion and then add the new record in there.

Edit    Delete  5000089     2012-03-17 04:31:46
Edit    Delete  5000087     2012-03-17 04:31:44
Edit    Delete  5000086     2012-03-17 04:31:43
Edit    Delete  5000085     2012-03-17 04:31:43
Edit    Delete  5000084     2012-03-17 04:31:31
**Edit  Delete  5000088     2012-03-17 04:31:30**
**Edit  Delete  5000076     2012-03-17 04:31:30**
Edit    Delete  5000082     2012-03-17 04:31:29

As you can see by the info about, at 4:31:30 GMT, we had 2 inserts, where it should have 83, and 84 but its incrementing weirdly. The database insert from the application does not specify the ID and the field of activity_id is set to Auto_increment.

Any help would be greatly appertained why this happening.

Has anyone see anything like this before?

  • 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-31T15:23:44+00:00Added an answer on May 31, 2026 at 3:23 pm

    The auto-increment documentation has this paragraph:

    In this case (when the AUTO_INCREMENT column is part of a
    multiple-column index), AUTO_INCREMENT values are reused if you delete
    the row with the biggest AUTO_INCREMENT value in any group. This
    happens even for MyISAM tables, for which AUTO_INCREMENT values
    normally are not reused.

    It seems to imply that index values are reused with InnoDB tables, and in certain cases in MyISAM tables. So, if you delete a row, there’s a chance MySQL will create a new row with the old row’s ID.

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

Sidebar

Related Questions

I have a table in my database with around 3000 records. One of the
I have a database table and one of the fields (not the primary key)
I have an Access database which has a table with around 6k records. When
we have a database table which has around 200,000 records. which includes 3 ntext
I have around 300 records in some table in mysql database. And I have
I have a database table with N records, each of which needs to be
I have a table in database that is having some fields one of which
I Have a set of choices(options) coming from Database(around 36 records) which I have
I have a data table with 600,000 records that is around 25 megabytes large.
I have a table from which I have to fetch around 7 million records,

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.