Can anybody (Alpha?) give me a definitive answer....
If I run an xbasic <tbl>.batch_begin() operation and end it with <tbl>.pack(), is there any reason to run <tbl>.batch_end()?
Actually, this could apply to any A5 version that has the batch_begin() command - v5 and later maybe.
Here's why the question:
I'm running a routine to archive some old records (actually 4 tables of them but based on the date in what would be the parent table of the set if they were in a set) and it runs MUCH faster when batch_begin() is used because there will often be many thousands of records archived at a time. As each record is copied out to the archive, it is also deleted. When the batch_end() runs, it seems to just update the indexes. If a Pack() operation is run before (or after) the batch_end(), the Pack() operation also updates the indexes. Consequently, running the Pack() operation and skipping the batch_end() seems to be adequate. If I DO run a batch_end() after the Pack() then the indexes are updated twice. Since two of the tables have 8-10 indexes and typically over 200,000 records, it takes a quite awhile.
My testing so far seems to indicate that it is NOT necessary to run the batch_end() after running the Pack() but, since I can't see "under the hood", I'm not absolutely positive. Since there are about 8 different companies using this application, I'd like to avoid any hidden problems.
If I run an xbasic <tbl>.batch_begin() operation and end it with <tbl>.pack(), is there any reason to run <tbl>.batch_end()?
Actually, this could apply to any A5 version that has the batch_begin() command - v5 and later maybe.
Here's why the question:
I'm running a routine to archive some old records (actually 4 tables of them but based on the date in what would be the parent table of the set if they were in a set) and it runs MUCH faster when batch_begin() is used because there will often be many thousands of records archived at a time. As each record is copied out to the archive, it is also deleted. When the batch_end() runs, it seems to just update the indexes. If a Pack() operation is run before (or after) the batch_end(), the Pack() operation also updates the indexes. Consequently, running the Pack() operation and skipping the batch_end() seems to be adequate. If I DO run a batch_end() after the Pack() then the indexes are updated twice. Since two of the tables have 8-10 indexes and typically over 200,000 records, it takes a quite awhile.
My testing so far seems to indicate that it is NOT necessary to run the batch_end() after running the Pack() but, since I can't see "under the hood", I'm not absolutely positive. Since there are about 8 different companies using this application, I'd like to avoid any hidden problems.
Comment