Manu
Manu

Reputation: 337

what is the best method to update and insert huge number of sql rows based on created timestamp on daily basis?

I have two tables A and B.Table A consists of status and created timestamp.Table B stores actions taken on Table A. (Every day at least hundred thousand records get stored into Table A).

I have to update status in table A if timestamp of the particular row doesn't belong to last week and insert the particular action in table B.

What are the best practices to solve this problem?

DO i have to run mysql script cron jobs or through java program(we use java in our project)?

Upvotes: 0

Views: 126

Answers (1)

Davide Lorenzo MARINO
Davide Lorenzo MARINO

Reputation: 26926

It is a design decision, both solutions can work well.

Choose the simplest to be developed for your knowledge and the simplest to be mantained.

A little tip on the database. If you have many data and you need to search only on the last week you can partition your table to get fastest results.

Upvotes: 1

Related Questions