Click here to Skip to main content
15,794,593 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, i've got 2 questions, first of all im creating a software to track the entrances and the exits of the cars on a parking lot, but to avoid system lag and future problems loading data, i would like to have a temporary table only for 24 hours and this temporary table will update the table that has all the data.With that i want to have another table with all the data that was inserted from the beggining. How am I going to figure out a way to tell the program that? Any sugestions?

What I have tried:

Looking for any sugestion, I dont really know how to figure it out. Apreciated!
F-ES Sitecore 16-Feb-16 9:11am    
You could enter data into your "last 24 hours" table and read from it as needed, then have a task that tuns every hour that moves (copies then deletes) records from the "last 24 hours" table into the "from beginning of time" table.

No point is asking for code as we don't know anything about how you are implementing things, what technology you're using, or what your database looks like.
Scribling Doodle 29-Feb-16 3:47am    
I'm using the latest version of mysql, i just wanted for a pre-built schema so i could look arround- My point is not to copy, but to learn and improve what's been given. That's what im looking for, thanks in advance.
ZurdoDev 16-Feb-16 10:03am    
If you index it properly you probably won't need a temp table. Or, you can always archive old data off.
Richard Deeming 16-Feb-16 11:06am    
If you're using Microsoft SQL Server, you probably want to look at Partitioned Tables[^].
BillWoodruff 16-Feb-16 16:56pm    
You might want to consider two Applications, and two Databases ?

The 24-hour app can save it's data every 24 hours, and reset: the all-data app can access and read the 24 hour data and update the main database. Total separation of concerns means a failure of the 24 hour app, or corruption of its data, may not affect the more highly secured main app.

Of course, this assume that there may be some security reasons, or other reasons, that only certain people can have access to the all-data app.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900