- Use conditions
- Automatic re-indexing
- "Hot" re-indexing
- Calculating statistics
- Directory of temporary files
- Managing non-Latin character sets
- Access rights to the data file
- Special case: Files corrupted after a computer reboot or a fatal error
HIndex (Function) In french: HRéindexe
 Available only with these kinds of connection
Rebuilds the file index (".NDX" file). You also have the ability to re-index the full-text indexes (".FTX" extension). A data file can be re-indexed even while it is accessed by applications. See remarks for more details. Reminder: The re-index operation re-organizes the indexes. After the re-index operation, the access to indexes is optimized. Re-indexing a data file can become necessary further to the loss or modification of the index file. HCheckIndex is used to check the status of index file on a regular basis. Remark: From version 19, HFSQL is the new name of HyperFileSQL. Versions 21 and later New in version 21
IF HIndex(AFile, hNdxNormal) = True THEN TableDisplay(TABLE_MyTable, taStart) END
Syntax
<Result> = HIndex([<Data file> [, <Mode> [, <eye> [, <Density rate>]]]])
<Result>: Boolean - True if the re-index operation was successfully performed,
- False otherwise. HError returns more details about the problem.
<Data file>: Optional character string (with or without quotes) Name of data file used. If this name is not specified, HIndex handles the last data file used by the last function for HFSQL management (starting with the letter H). <Mode>: Optional Integer constant (or combination of constants) Configure the re-index operation: | | hChangeCharset | Re-indexing with change of character set. The new character set defined by ChangeCharset will be taken into account during the re-index operation. The sorts, the searches, ... on string keys (strings, characters, date and time) will be performed according to this character set. | hFTX | Re-indexing full-text indexes. | Versions 20 and laterhMmoCompact New in version 20hMmoCompact hMmoCompact | Compressing and defragmenting "Mmo" files. Caution: This constant cannot be combined with the hNdxCompact, hFTX, hNdxMinimal, hNdxSilent, hNdxNormal or hNdxDelete constants. | hNdxCompact | Re-indexing with compression (keeps the active records only. All the other records are permanently deleted). | hNdxMinimal | Re-indexing while taking the corrupted keys into account only. This parameter is ignored if the hNdxDelete or hNdxCompact constant is enabled. | hNdxSilent | Re-indexing without display | hNdxNormal (default value) | Standard re-indexing (with statistics and without compression) The statistics are used to optimize the queries and the filters (see the Notes) | hNdxNoStat | Re-indexing without statistical calculation. This constant increases the available space by reducing the size of index files. Caution: The statistics are very important to get correct execution times when using queries, filters with condition and views with condition. | hNdxDelete | Re-indexing while deleting damaged records | Versions 15 and laterhBackgroundTask New in version 15hBackgroundTask hBackgroundTask | | hCheckMemo | Standard re-indexing with memo check and correction if necessary (used to retrieve the damaged memos). Versions 23 and later New in version 23 | Remark: The re-index operation dos not compress the memos. You must use WDOptimizer to perform this operation (option 5 of WDOptimizer). <eye>: Optional window name, field name or integer - Name of window where the progress bar will be displayed,
- Name of the Gauge field displaying the progress of the reindexing,
- Identifier (Handle) of window that displays the progress bar.
<Density rate>: Integer included between 1 and 100 Density rate of indexes. This rate is set to 80 by default. Density rate of indexes. This rate is set to 60 by default. The higher this rate is, the denser and smaller the index is. In this case, the browses, searches, filters and queries will be faster. The additions of records and the modifications of records may be slower. The smallest this rate is, the less dense and the bigger the index will be. In this case, the browses, searches, filters and queries will be slower. The additions of records and the modifications of records will be faster. Caution: this parameter can only be used on the data files in HFSQL format.
Remarks Use conditions - The function HIndex allows you to re-index an xBase file.
Versions 21 and laterThe function HIndex allows you to reindex the files of a cluster. In this case: - The re-index operation is performed on the node to which the user is connected.
- Only a hot re-indexing is available (hBackgroundTask constant).
New in version 21The function HIndex allows you to reindex the files of a cluster. In this case: - The re-index operation is performed on the node to which the user is connected.
- Only a hot re-indexing is available (hBackgroundTask constant).
The function HIndex allows you to reindex the files of a cluster. In this case: - The re-index operation is performed on the node to which the user is connected.
- Only a hot re-indexing is available (hBackgroundTask constant).
Calculating statistics The statistical calculations are used to optimized the queries and the filters on the data file. The statistical calculations can also be performed by HStatCalculate. Remark: In order for the statistical calculation to be efficient, this calculation must be performed on all the data files (for a multi-file query for example). Directory of temporary files Temporary files can be created during the re-index operation. By default, these files are created in the Windows temporary directory or in the current directory if there is not enough space. The H.TemporaryDirectory variable allows you to configure the directory used to save these temporary files. This variable is recommended when re-indexing huge data files.
Versions 17 and later New in version 17Access rights to the data file The re-index operation provokes the re-creation of the data file on disk. In an allocation system managing the rights at file level (NTFS, ...), the data file after re-indexing will have the rights of the directory to which it belongs. Before the re-index operation, if the data file had specific rights different from the rights of the folder, they must be redefined in Windows after the re-index operation. Special case: Files corrupted after a computer reboot or a fatal error The data files may be corrupted when the computer is unexpectedly rebooted. In this case, the data files contain invalid data (unreadable characters for example). To fix this problem: - Perform a re-indexing with deletion.
- Free the records in transaction with HTransactionFree.
- Delete the incorrect records with WDMAP.
This page is also available for…
|
|
|