| Network Contention |
| Index Sub Revisited |
| Rebuilding Indexes |
| Utility Diskette # 3 - Part I |
| Utility Diskette # 4 |
| QTIPS - Using @Upper.Case and @Lower.Case with Foreign Languages |
| @ATTACK - @Lower.Case |
| @ATTACK - @Upper.Case |
| Sorting out Collation Sequences by Mike Pope |
| SecureUser |
| VERBatim - V25 |
| @ATTACK - @Files.System |
| Advanced Revelation Initialisation Sequence (Overview) by Mike Pope |
| REVMEDIA Revisted |
| !File Records |
| QTIPS - Updating Indexes |
| Indexing on Xlates |
| Rebuilding Indexes |
| How Indexes Are Updated |
| Index Record Layouts |
| Index Flush |
| REVMEDIA Revisited |
| Reader's Clinic - Fixing %Windows% Using Depend.Update |
| QTIPS - Updating Indexes |
| How Indexes Are Updated |
| REVMEDIA Revisted |
| Make.Index |
| QTIPS - Btree.Extract |
| !File Records |
| Index Sub Revisited |
| QTIPS - Stop Lists |
| Reader's Clinic - Stop Lists |
| Utility Diskette # 4 |
| QTIPS - Manipulating XREF formulae. |
| Reader's Clinic - Functions and Subroutines |
| Argument passing - Subroutines and Functions - Mike Pope |
| Form.List.S |
| QTIPS - Aesthetically Improving RLIST Reports |
| QTIPS - Form Processor |
| QTIPS - Suppressing Initial Form Feed |
| QTIPS - Using RTP29 In Place of V6 |
| RTP Series - RTP57 |
| File Variables |
| Reader's Clinic - Volume Pointer Record |
| REVMEDIA Revisted |
| Utility Diskette # 4 |
RevMedia FKB
| Document | V2I8A8 |
| Title | Rebuilding Indexes |
| Keywords | INDEX.FLUSH INDEX.SUB REBUILD INDEX !INDEXING |
| Text | Gordon French of Fort Lauderdale recently asked WITH reference to the INDEX SUB program included on Utility Diskette Number 1 "How is it possible to force a rebuild of an index for a file?" The INDEX SUB routine does not actually force a rebuild as it assumes that you will be REBUILDING after adding a new index in which case it will work perfectly If however it is suspected that the INDEXES have become corrupted it can be long winded calling INDEX SUB to remove readd then rebuild the INDEXES It is possible to instruct the system to rebuild the index for a field by mimicking the action taken by the system when it adds an index to a field The system simply writes a record to the !INDEXING file containing information about the file to update and the keyword %%ALL IDS%% The listing below shows a generic routine designed to allow the REBUILDING of indexes FROM within an RBASIC program To use call WITH the file name and the field name/index name (EG USER COMPANY_NAME XREF CUST*INV*AR) Note network users should ensure they incorporate LOCKING logic into this subroutine SUBROUTINE REBUILD_INDEX(FILE FIELD) * * Author AMcA * Date Jan 91 * Purpose To rebuild an index for a field * COPYRIGHT Sprezzatura Ltd 1991 Permission given to * REVMEDIA subscribers to use in any form DECLARE SUBROUTINE FSMSG OPEN "!INDEXING" TO IFILE THEN GOSUB GET_VOL_INFO GOSUB UPDATE_INDEX_FILE END ELSE FSMSG() END RETURN GET_VOL_INFO: FILE_REC = XLATE("FILES" FILE "" "X") VOL_REC = XLATE("VOLUMES" FILE_REC<1> "" "X") VOL_INFO = FILE_REC<2>:"*":FILE_REC<3>:"*":VOL_REC<1> RETURN UPDATE_INDEX_FILE: UPDATE_REC = VOL_INFO ; * Volume Information UPDATE_REC<2> = 1 ; * Number of transactions UPDATE_REC<3> = FIELD ; * Index to update UPDATE_REC<4> = "%%ALL IDS%%" ; * Rebuild Flag UPDATE_REC := @FM : @FM : @FM READ ZERO_REC FROM IFILE "0" ELSE ZERO_REC = @FM * Ensure there is a trailing field mark IF INDEX(ZERO_REC @FM 1) ELSE ZERO_REC := @FM ZERO_REC := UPDATE_REC WRITE ZERO_REC TO IFILE "0" CALL INDEX FLUSH(VOL_INFO '') RETURN (Volume 2 Issue 8 Page 7) |
Page last modified: 30/01/03