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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:47:39+00:00 2026-06-12T03:47:39+00:00

I am new to MySQL partitioning, therefore any example will be appreciated. I am

  • 0

I am new to MySQL partitioning, therefore any example will be appreciated.

I am trying to create a sort of an ageing mechanism for a data that is distributed between several MyISAM tables.

My question will actually include several sub-questions.

The relevant tables are:

  1. First table contains raw data with high input frequency (next to each record there is an auto incremented id).
  2. Second table contains processed results, there is a result record per every raw data record (result record contains the source id record of the auto incremented field of raw data record)

Questions:

  1. I need to be able to partition the raw data table and result data table similarly so that both of them will include only 10 weeks of data in single partition (each raw data record contains unixtimestamp field), how do i do it , can someone write small example case for two such tables?.
  2. I want to be able to change the 10 weeks constraint on the fly.
  3. I want that when ever the current partition will be filled or a new partition is created , the previous (10 weeks before) partition will be deleted automatically.
  4. I don’t want the auto increment id integer to be overflown, as much as i understand the ids are unique for the partition only, so if i am not wrong the auto increment id will start from zero for the next partition? but what if the previous partition still exist, will i have 2 duplicated ids , how i know to reference only for the last id when i present a result record?
  5. I want to load raw data using LOAD DATA INTO… instead of multiple inserts , is MySQL partitioning functionality affected?

And the last question, would you suggest some other approach to implement aging mechanism (i am writing Java implementation product that processes around 1 GB or raw data per day and stores the results in MySQL)

  • 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-12T03:47:40+00:00Added an answer on June 12, 2026 at 3:47 am

    It’s hard to give a real answer on this question since it depends on your data. But let me give you some things to think about.

    1. I assume we’re talking about some kind of logs with recent data (so not spanning multiple years). You can partition by range. You could add one field to your table with the year/week number (ie 201201, 201202, etc). If this question is related to your question about importing into multiple tables, you can easily do this is that import script.

    2. On the fly as in, repartition your data on the fly (70GB?). I would not recommend it. But you could do it if you had the weeknumber in there. If you later want to change it to 12 days, you could add a column for the date and partition by that.

    3. Well it won’t be deleted automatically but a cron job can handle that right? Just check how many partitions there are, and if there are 3(?) delete the first one.

    4. The partition needs to have a primary index on the field that you partition (if you want to use auto increment). Therefor you can never fully rely on the auto increment id alone. I don’t see a way around this.

    5. I’m not sure what you mean.

    If your data is just some logs in chronological order then you might just use separate tables for each period. Then before you start the new period (at 00:00) check the last id of the last table, create a new table and set the auto increment to that value +1. Then your import will decide when a new period will begin so it can be easily changed. Your import script can use a small table in where it can store the next period.

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

Sidebar

Related Questions

I'm just trying to create a new MySQL database with a few simple tables.
I'm trying to create a new MySQL from a SELECT statement: CREATE TABLE site_database
Can we create a new MySQL database( not a table, I want a new
[...] public DataSet ReturnPromoMagazinesDs() { MySql.Data.MySqlClient.MySqlConnection mysqlConnection = new MySql.Data.MySqlClient.MySqlConnection(this.connectionString); MySql.Data.MySqlClient.MySqlCommand mysqlCommand = new
I am new to mysql. I googled but couldn't find any satisfactory answer. Basically,
I'm very new to MySQL and I have a stored procedure that I'd like
During the installation I need to create new MySQL user, new database and populate
When I create a new MySQL database through phpMyAdmin, I have the option to
Is there a way within Rails/AR to create a new mysql database at runtime?
I'm trying to learn the ropes of some new MySQL syntax and am having

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.