AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Use conditions
  • Automatic reindexing
  • "Zero-downtime" reindexing
  • Calculation of 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 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
Rebuilds the file index (".NDX" file). It is also possible to re-index:
  • full-text indexes (extension ".FTX" files),
  • Novedad versión 2024
    spatial indexes (extension ".SDX" files).
A data file can be reindexed even when it is accessed by applications. For more details, see the remarks.
Reminder: Re-indexing reorganizes indexes and can free up space left when records are deleted.. After the reindex operation, the access to indexes is optimized. Reindexing a data file can become necessary further to the loss or modification of the index file. HCheckIndex is used to regularly check the status of the index file.
IF HIndex(UnFichier, hNdxNormal) = True THEN
TableDisplay(TABLE_MaTable, taStart)
END
Sintaxis
<Result> = HIndex([<Data file> [, <Mode> [, <eye> [, <Density rate>]]]])
<Result>: Boolean
  • True if the reindex operation was successfully performed,
  • False otherwise. HError returns more details about the problem.
<Data file>: Optional character string
Name of the data file used.
If this name is not specified, HIndex will use the last data file used by the last HFSQL function (function starting with "H").
<Mode>: Optional Integer constant (or combination of constants)
Configure the reindex operation:
hChangeCharsetReindexing with change of character set.
The new character set defined by ChangeCharset will be taken into account during the reindexing. Sorts, searches, ... on string keys (strings, characters, date and time) will be performed according to this character set.
hFTXReindexing full-text indexes.
hMmoCompactCompacting and defragmenting "Mmo" files.

Caution: This constant cannot be combined with the hNdxCompact, hCheckMemo, hFTX, hNdxNormal or hNdxDelete constants.
hNdxCompactReindexing with compression (keeps the active records only. All the other records are permanently deleted). The space left unoccupied by deletions is recovered in the data file ".FIC" and in the ".NDX" index..
Remark: If Record s are in transaction, compaction is automatically deactivated..
hNdxMinimalReindexing while taking the corrupted keys into account only. This parameter is ignored if the hNdxDelete or hNdxCompact constant is enabled.
hNdxSilentReindexing without display
hNdxNormal
(default value)
Standard reindexing (with statistics and without compression).
The statistics are used to optimize the queries and the filters (see the Notes). Only active records are taken into account for calculating statistics.
hNdxNoStatReindex without calculating statistics. 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.
hNdxDeleteReindex and delete damaged records.
Novedad versión 2024
hSDX
Re-indexing spatial indexes.
hBackgroundTask
HFSQL Client/Server Reindexing performed in background task. The applications are not locked during the reindex operation.
This feature is available in Client/Server mode only.
hCheckMemoStandard reindexing with memo check and correction if necessary (used to retrieve the damaged memos).
WEBDEV - Código Servidor Remark: Before reindexing memos, you have the ability to check the status of memos via HCheckMemo.
<eye>: Optional control or window name, or optional integer
  • Name of the window in which the progress bar will be displayed,
  • Name of the Progress Bar control that displays the reindexing progress,
  • Handle of the window that displays the progress bar.
WEBDEV - Código Servidor This parameter is ignored.
<Density rate>: Integer included between 1 and 100
Density rate of indices. This rate is set to 60 by default.
The higher this rate is, the denser and smaller the index is. In this case, iterations, 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, iterations, 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.
Observaciones

Use conditions

  • HIndex reindexes an xBase file.
  • HIndex reindexes the files of a cluster. In this case:
    • The reindex operation is performed on the node to which the user is connected.
    • Only a zero-downtime reindexing is available (hBackgroundTask constant).
WEBDEV - Código ServidorAjaxHFSQL ClassicHFSQL Client/Server

Automatic reindexing

Reindexing a data file can become necessary further to the loss or alteration of index file. An automatic reindex operation can be implemented for the data files.
To implement an automatic reindex operation, you must:
  • configure the value of the 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 the 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. For more details, see HFSQL error handling help.
    During the reindex 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 reindex operation.
    HFSQL Client/Server If the hBackgroundTask constant is used, the reindex 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 reindexing.
Remarks:
  • During the automatic reindexing, the reindex operation is performed in normal mode (hNdxNormal constant).
  • No automatic reindexing is available for data files in Hyper File 5.5 format.
  • If an automatic reindexing is performed, the applications that use the data files currently reindexed are temporarily locked. A message is displayed, indicating that the file is currently maintained.
  • At the end of the reindex operation, the current HyperFileSQL context is automatically restored (except if a reindex operation with memo check was performed).
WEBDEV - Código ServidorAjaxHFSQL ClassicHFSQL Client/Server

"Zero-downtime" reindexing

A data file can be reindexed even when 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 reindex operation.

Calculation of statistics

Statistics are used to optimize the queries and filters on the data file. Only active records are taken into account for these statistics. HStatCalculate also returns the results of this calculation.
Remark: To efficiently calculate statistics, all data files must be included. This is the case of 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 reindexing large data files.
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. Reindex the data file with HIndex. Use the hChangeCharset constant to use the character set specified by ChangeCharset.
For more details, see Managing specific character sets in the data files.

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 the reindex operation 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 reindexing with deletion.
  2. Free the records in transaction with HTransactionFree.
  3. Delete the incorrect records with WDMAP.
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd290hf.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 20/02/2024

Señalar un error o enviar una sugerencia | Ayuda local