Rebuild all indexes in a table at one time from a program? (AREV Specific)
At 13 JUN 2001 05:06:11PM Michael Slack wrote:
Under AREV 3.12, I've got two identical applications. One has live data and the other is a training application. We would like to copy the data files from the live application into the same tables (different REV file numbers) in the training application. I've already have a skeleton program written that does all of this so far. What I'm trying to figure out is how to speed up the rebuilding of the indexes on a table in the training application.
In reading thru this on-line discussion area and the knowledge base, the most promising candidate is REBUILDINDEX_SUB. It looks straight forward but I have the question on the FLAGALL subroutine variable. It indicates that I can set this to 1 if all of the indexes on the table is going to be rebuilt. My question is, do I still need to define all of the indexes that are to be rebuilt or not in the FIELDINFO variable?
What I'd really like to be able to do is call the same routine that I can get to by hitting F10 at TCL and then selecting DB ADMIN, INDEX, UPDATE, REBUILD ALL INDEXES IN A SINGLE TABLE. What I initially tried in the program I'm building was to just flushing the indexes after the data had been copied over but that took way too much time on the really big tables. When I did esintially the same thing but by hand initiated the rebuild of the indexes thru the menu options, that rebuild went much faster.
Thank you for your time,
Michael Slack
At 13 JUN 2001 05:55PM Warren wrote:
Download my INDEX_REBUILDER utility (rebuild.zip) from my iDrive account in the Shared files folder.
This should do what you want. Works with all versions of AREV but be sure to read the notes and comments in the code before compiling and cataloging. A REVMEDIA file is included in the zip so unzip to a directory that does not contain REVxxxxx files.
NOTE: iDrive is shutting down 18 June so download it before then or else I can email it to you.
At 14 JUN 2001 12:04PM Michael Slack wrote:
Hello Warren:
Thanks for the program, it looks good. I've already incorporated a call to the INDEX_REBUILDER into my skeleton program I'm working on. With just a quick read thru your program, it has answered a couple of questions that I had on the REBUILDINDEXES_SUB process.
I've only had to make two very slight modifications so I could make your program work with my process and system. The first was the $INSERT INCLUDE, for my system I had to change it to $INSERT SYSINCLUDE (maybe because I have a 3.12 system). Then I commented out the LOGOFF and STOP right after it displays the start and end times of the index rebuild process. I did this so that it would return to my calling program and start working on the next table in the list.
I plan on sitting down with your INDEX_REBUILDER program for a good read to see what I read in the knowledge base and on-line discussion is actually put into practice.
Thanks for your help,
Michael Slack
At 15 JUN 2001 12:53PM Warren wrote:
Sprezzatura has some excellent related items in their Revmedia archives also.
Feel free to modify and cannibalize the code as you see fit.
Glad I could help.