Introduction: This document will guide a user through the following index processes:
- Removing Indexes Manually
- Updating the Volume Directory
- Indexing Table
- Updating the Dictionary
- Btree Indexes
- Cross Reference Indexes
- Relational Indexes
- Final Steps in OpenInsight
When to Remove an Index Manually
This may be required when corruption or data loss occurs to the index portion of your data file (!file). If this error occurs, ensure that you have a Revelation NLM or Revelation NT Service installed and running on your system.
The first step to remove indexes manually, involves the following:
- Log into your SYSPROG application.
- From the System Editor’s command line, Run ATTACH_TABLE ‘path','REVMEDIA’ from the exec line of the system editor. (Where path is the DOS path to the OpenInsight directory that contains your OpenInsight data.) Example of default path: c:\revsoft\openinsight\datavol
- Select File-Open Record from the main menu
- Enter REVMEDIA for the Table name
- Enter TABLE*APPLICATIONfor the Row
- Remove the SI.MFS in the second field of the record
- Save the record
- Exit the record
You may now begin the process of removing indexes manually, as follows:
||How to Remove the Index Manually
||Log into your application that contains the table that you are removing the index.
||Open the SystemEditor.
||Delete the indexed table. This can be done by typing at the exec: line, run delete_table ‘!TABLENAME’ (where TABLENAME is the table that has the index applied to it).
Updating the Dictionary
The indexing system provides a variety of information in the dictionary record of an indexed field. Depending on the type of indexing, different information is maintained. You will have to edit the dictionary record of every field in the table that was indexed.
||How to Update the Dictionary
||Select File-Open Record from the main menu.
||Open the appropriate dictionary TABLE and ROW.
Field 6 of the dictionary record tells the system whether or not this field has a Btree index. If there is a 1 in this field, the field has had a Btree index applied. Change this 1 to a 0 and save the record.
Cross Reference Indexes
When a Cross Reference index is placed on a field, a symbolic field is created to maintain the index. This field can be identified by the XREF
extension. Because this is no longer required, it should be deleted. This can be done by entering the System Editor and at the exec: line typing run delete_row ‘DICT.TABLENAME’,’FIELD_XREF’
. In addition, a field with a Cross Reference index has the name of the Cross Reference symbolic field in field 22 of the dictionary record.
Relational indexes use several fields in the dictionary record to store their control information.
||How to Delete a Relational Index
||In the record that serves as the target of the relational index, change the 1 on line 25, which tells the system that this field's data is protected, to a 0.
||Line 24 contains the name of the relational index; this should be deleted.
||To completely remove the relational index, the dictionary of the source file must also be edited. In that dictionary, the source field will have the name of the related field on line 23. Delete this line.
||Save the records and exit.
Final Steps in OpenInsight
There are two other records in the dictionary that should be deleted, %PROTECT.SPEC% and %FIELDS%.
From the System Editor EXEC line, run the following two lines:
- Run DELETE_ROW 'DICT.TABLENAME','%PROTECT.SPEC%'
- Run DELETE_ROW 'DICT.TABLENAME','%FIELDS%'
After deleting these records, reattach the file and the system will recreate these records, reflecting the changes made to the dictionary.
At this point the file has had all indexes removed. Indexes can be re-established as necessary.