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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:28:25+00:00 2026-05-11T05:28:25+00:00

I have a database full of time-sensitive data, so on a daily basis I

  • 0

I have a database full of time-sensitive data, so on a daily basis I truncate the table and then import the new data (from a merge of other databases) into the truncated table.

Currently I am running OPTIMIZE on the table after I have imported the daily refresh of data. However, looking at the mysql OPTIMIZE syntax page http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html

it says I can optimize to reclaim unused space and defrag the data.

So should I being running OPTIMIZE twice? Once when I delete the data, and then again after I’ve reinserted it? or just once? and if just once, should it be after loading the new data? or after clearing out the old?

  • 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. 2026-05-11T05:28:26+00:00Added an answer on May 11, 2026 at 5:28 am

    it may depend upon whether you are using MyISAM or InnoDB tables, but i would run the OPTIMIZE after truncating the table. This should ensure space is reclaimed and it will run very quickly.

    When you insert your batch of data it should all insert in order and not be fragmented anyway, and since it’s a fresh insert there will be no space to reclaim. If it’s a small dataset it may not matter too much, but on a large dataset doing the OPTIMIZE after the insert could also be quite slow.

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

Sidebar

Related Questions

I have a database table full of time points and experimental values at those
I have a database table full of some really ugly and messy data. In
I have a database full of customer data. It's so big that it's really
I have a database full of two-dimensional data - points on a map. Each
I have a database with a table which is full of conditions and error
I have a database table which is full-text indexed and i use the CONTAINS-function
I have a database table with 5 rows. The first time I do a
I successfully deleted all records from a table in a database. I have a
I have a database table that is full of transactions transactionIDs and datetime fields.
I have a database full of messages from a bulletin board. The board uses

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.