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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:10:06+00:00 2026-05-26T18:10:06+00:00

I have a database table with 10,000,000+ rows which I process to create a

  • 0

I have a database table with 10,000,000+ rows which I process to create a new table. What is the best type of storage engine for reading?

Currently I use:

$sql = "UPDATE `packages_unsorted` SET `acv_return_viadetails` = '0';";

Then to select the records:

$sql = "SELECT * FROM `packages_unsorted` WHERE `acv_return_viadetails` = '0' LIMIT 1000;";

I collect the primary key id into an array called $ids and I process the records and write the data to a CSV file for import at the end of each 1000 rows.
I then update the acv_return_viadetails field with:

$sql = "UPDATE `packages_unsorted` SET `acv_return_viadetails` = '1' WHERE `id` IN ('".implode("','",$ids)."') LIMIT 1000;";

As the above is the only write to the table and I select all fields every time. Should I be using a memory table or some other type of storage engine to make things faster? Or are there any other optimizations I could introduce that would speed things up?

Also what would be a reasonable my.cnf configuration for such an operation.

Thanks in advance 🙂

  • 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-26T18:10:07+00:00Added an answer on May 26, 2026 at 6:10 pm

    A few suggestions:

    1) Replace

    $sql = "SELECT * FROM `packages_unsorted` WHERE `acv_return_viadetails` = '0' LIMIT 1000;";
    

    with

    $sql = "SELECT `id` FROM `packages_unsorted` WHERE `acv_return_viadetails` = '0' LIMIT 1000;";
    

    2) Check if it is possible to load all the ids at once without the 1000 limit. With 10M records, it should take only a few hundred MBs to load all the ids.

    $sql = "SELECT `id` FROM `packages_unsorted`";
    

    If not, consider increasing the limit.

    3) You can try something like the following instead of using acv_return_viadetails:

    $sql = "SELECT `id` FROM `packages_unsorted` LIMIT 0, 1000;";
    $sql = "SELECT `id` FROM `packages_unsorted` LIMIT 1000, 1000;";
    $sql = "SELECT `id` FROM `packages_unsorted` LIMIT 2000, 1000;";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table (session) in a database which has almost 72,000 rows. I
We have a (currently InnoDB) table which contains roughly 500,000 rows. This represents a
I have 10,000 rows in database table. I have a view which is suppose
We have a table in our database which has around 2,500,000 rows (around 3GB).
I have a table of over 150,000 rows of which most would be updated
I have a huge dataset (around 5 000 000 rows in a database) which
I have a database table (named Topics) which includes these fields : topicId name
I have a database table called Posts which stores all the information regarding an
I have a database table with a large number of rows and one numeric
Lets say I have a database table which consists of three columns: id ,

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.