PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • 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
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
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.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 19 and later
Android This function is now available for the Android applications that use data files in HFSQL format.
Android Widget This function is now available in Android Widget mode.
Java This function is now available for the Java applications.
New in version 19
Android This function is now available for the Android applications that use data files in HFSQL format.
Android Widget This function is now available in Android Widget mode.
Java This function is now available for the Java applications.
Android This function is now available for the Android applications that use data files in HFSQL format.
Android Widget This function is now available in Android Widget mode.
Java This function is now available for the Java applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server code This function is now available to reindex the data files of a HFSQL cluster.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server code This function is now available to reindex the data files of a HFSQL cluster.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server code This function is now available to reindex the data files of a HFSQL cluster.
IF HIndex(AFile, hNdxNormal) = True THEN
        TableDisplay(TABLE_MyTable, taStart)
END
Syntax
<Result> = HIndex([<File Name> [, <Mode> [, <Progress Bar> [, <Density Rate>]]]])
<Result>: Boolean
  • True if the re-index operation was successfully performed,
  • False otherwise. HError returns more details about the problem.
<File Name>: 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:
hChangeCharsetRe-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.
hFTXRe-indexing full-text indexes.
Versions 20 and later
hMmoCompact
New in version 20
hMmoCompact
hMmoCompact
Compressing and defragmenting "Mmo" files.
Caution: This constant cannot be combined with the hNdxCompact, hFTX, hNdxMinimal, hNdxSilent, hNdxNormal or hNdxDelete constants.
hNdxCompactRe-indexing with compression (keeps the active records only. All the other records are permanently deleted).
hNdxMinimalRe-indexing while taking the corrupted keys into account only. This parameter is ignored if the hNdxDelete or hNdxCompact constant is enabled.
hNdxSilentRe-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)
hNdxNoStatRe-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.
hNdxDeleteRe-indexing while deleting damaged records
Versions 15 and later
hBackgroundTask
New in version 15
hBackgroundTask
hBackgroundTask
HFSQL Client/Server Re-indexing performed in background task. The applications are not locked during the re-index operation.
This feature is available in Client/Server mode only.
hCheckMemoStandard re-indexing with memo check and correction if necessary (used to retrieve the damaged memos).
Versions 23 and later
WINDEVWEBDEV - Server code Note: Before re-indexing memos, you have the ability to check the status of memos via HCheckMemo.
New in version 23
WINDEVWEBDEV - Server code Note: Before re-indexing memos, you have the ability to check the status of memos via HCheckMemo.
WINDEVWEBDEV - Server code Note: Before re-indexing memos, you have the ability to check the status of memos via HCheckMemo.
Note: The re-index operation dos not compress the memos. You must use WDOptimizer to perform this operation (option 5 of WDOptimizer).
<Progress Bar>: Optional character string (with or without quotes) or integer
  • Name of window where the progress bar will be displayed or name of Progress Bar control.
  • Identifier (Handle) of window that displays the progress bar.
    WEBDEV - Server code This parameter is ignored.
<Density Rate>: Integer included between 1 and 100
Density rate of indexes. This rate is set to 80 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.
Hyper File 5.5 This parameter cannot be used.
Remarks

Use conditions

  • HIndex is used to re-index an xBase file.
  • Versions 21 and later
    HIndex is used to reindex the files of a cluster. In this case:
    • The reindex operation is performed on the node to which the user is connected.
    • Only a hot reindexing is available (hBackgroundTask constant).
    New in version 21
    HIndex is used to reindex the files of a cluster. In this case:
    • The reindex operation is performed on the node to which the user is connected.
    • Only a hot reindexing is available (hBackgroundTask constant).
    HIndex is used to reindex the files of a cluster. In this case:
    • The reindex operation is performed on the node to which the user is connected.
    • Only a hot reindexing is available (hBackgroundTask constant).
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadWindows MobileUniversal Windows 10 AppAjaxUser code (UMC)External languageHFSQLHFSQL Client/Server

Automatic re-indexing

Re-indexing a data file can become necessary further to the loss or alteration of index file. An automatic re-index operation can be implemented for the data files.
To implement an automatic re-index operation, you must:
  • configure the value of H.AutoIndexingLimit variable.
    Indeed, if the data file contains less than H.AutoIndexingLimit records, the reindex operation is automatically performed if an index error occurs.
    The H.AutoIndexingLimit variable is set to 10000 by default. The automatic reindex operation is disabled if this variable is set to 0.
  • configure the value of H.VisibleAutoIndexing variable.
    If this value is set to True (default value), a window is automatically displayed as long as the automatic reindex operation is not completed. This window contains a progress bar used to follow the progress of the current reindexing. This window can be customized. See Assisted management of HFSQL errors for more details.
    During the re-index operation, the different applications that use the file data (read or write records) will be temporarily stopped and/or locked until the end of the re-index operation.
    Versions 15 and later
    HFSQL Client/Server If the hBackgroundTask constant is used, the re-index operation is performed in background task and the applications that use the data file are not stopped.
    New in version 15
    HFSQL Client/Server If the hBackgroundTask constant is used, the re-index operation is performed in background task and the applications that use the data file are not stopped.
    HFSQL Client/Server If the hBackgroundTask constant is used, the re-index operation is performed in background task and the applications that use the data file are not stopped.
If an error occurs during the automatic reindex operation (lock error on the data file or on the record for example), the automatic reindex operation is stopped and a fatal error (corrupted index) is displayed. This operating mode is similar to the one without automatic re-indexing.
Notes:
  • During the automatic re-indexing, the re-index operation is performed in normal mode (hNdxNormal constant).
  • No automatic re-indexing is available for the data files in Hyper File 5.5 format.
  • If an automatic re-indexing is performed, the applications that use the data files currently re-indexed are temporarily locked. A message is displayed, indicating that the file is currently maintained.
  • At the end of the re-index operation, the current HyperFileSQL context is automatically restored (except if a re-index operation with memo check was performed).
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 AppJavaAjaxUser code (UMC)HFSQLHFSQL Client/Server

"Hot" re-indexing

A data file can be re-indexed even while it is accessed by applications.
During the reindex operation, the different applications that use the file data (reading or writing records) will be temporarily stopped/locked until the end of the re-index operation.
WINDEV A window is displayed, indicating that the data file is currently re-indexed (also called reorganization). This window is displayed during the entire re-index operation and it cannot be closed. A progress bar indicates the status of re-index operation.
You can customize this window and/or not display it anymore. See Assisted management of HFSQL errors for more details.
To avoid flashing effects, the indexing window is displayed only if the indexing operation may exceed 2 seconds. In this case, this window is displayed after 0.7 seconds.
Note: no "live" reindexing can be performed if records are locked in read/write mode in the data file to reindex. If the records are locked in write mode only, the hot reindex operation can still be performed.
Versions 15 and later
HFSQL Client/Server If the hBackgroundTask constant is used, the re-index operation is performed in background task and the applications that use the data file are not stopped.
New in version 15
HFSQL Client/Server If the hBackgroundTask constant is used, the re-index operation is performed in background task and the applications that use the data file are not stopped.
HFSQL Client/Server If the hBackgroundTask constant is used, the re-index operation is performed in background task and the applications that use the data file are not stopped.

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.
Note: 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 reindex 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
HFSQL Client/Server The directory used to store the temporary files on the server can be defined:
New in version 17
HFSQL Client/Server The directory used to store the temporary files on the server can be defined:
HFSQL Client/Server The directory used to store the temporary files on the server can be defined:

Managing non-Latin character sets

To modify the character set used for the searches, the sorts:
  1. Specify the character set to use with ChangeCharset.
  2. Re-index the data file with HIndex. Use the hChangeCharset constant to take into account the character set specified by ChangeCharset.
See Managing specific character sets in the data files for more details.

Access rights to the data file

The reindex 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 reindex operation, if the data file had specific rights different from the rights of the folder, they must be redefined in Windows after the reindex 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:
  1. Perform a re-indexing with deletion.
  2. Free the records in transaction with HTransactionFree.
  3. Delete the incorrect records with WDMAP.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment