Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Archiving Data
Message
 
To
24/08/2004 11:13:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00935945
Message ID:
00935955
Views:
18
Hi Chris,

If you know beforehand how many records you'll be adding to the archive table, you can do the calculations at the beginning and then limit the number of records to add to the table.

Alex


>We've got a table in our application that can (has) reach the foxpro limit of 2GB and/or reach 1 billion records for some of our clients. In the past we've manually archived the data for them.
>
>Right now I'm working on a mechanism that will allow our clients to archive their own data. In a nutshell, the mechanism will move records from "mybigtable" to "mybigarchivetable1". If "mybigarchivetable1" is full it will create "mybigarchivetable2" and start moving the records in that table.
>
>I've got it all figured out except for one thing. I have to check if "mybigarchivetableX" has reached the 2GB or 1 billion record limit before adding a record to it. I figured I can use RECCOUNT() to check the record count and use HEADER() + (RECSIZE() * RECCOUNT() + 1) to check the file size. But to me it would seem that it would really slow down the process if it performed those checks before inserting every record. There's got to be a way that I could check every 1000th record or something like that. So something like:
>
>
>LOCAL lnRecCount, lnFileSize
>lnRecCount = RECCOUNT() + 1000
>lnFileSize = HEADER() + (RECSIZE * lnRecCount) + 1)
>IF !(lnRecCount < 1 billion and lnFileSize < 2 GB)
>  * create new archive table
>ENDIF
>* archive records
>
>
>The thing I'm not sure of is should I check every 1000th record or something higher or lower? If anyone has done something like this before I would like to hear your advice.
>
>Thanks,
>Chris
Low-carb diet not working? Try the Low-food diet instead!
Previous
Reply
Map
View

Click here to load this message in the networking platform