ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Performs various statistical calculations on the file keys.
This function is equivalent to HAccelerateSpeed.
These statistics are used when implementing a filter, creating a query or creating a view on the data file. The HFSQL engine analyzes the selection condition, then uses these statistics to define the most discriminating items that will be used to optimize iterations on data files.
The statistics are used to get information about the content of the data file when they are calculated. Also, the more modifications there are to the data file after this calculation, the less faithful these statistics are to the content of the data file. The more records the data file contains, the less the modification of a single record impacts the overall statistics.
Caution: function <Source>.StatCalculate blocks the data file from being written to while statistics are being calculated (the data file is scanned for each key in the data file)..
HFSQL Client/Server The statistics can be calculated in background task without locking the data file in write mode.
New in SaaS
HFSQL Client/Server Statistics for an HFSQL Client/Server data file can be calculated asynchronously using the <Connexion HFSQL>StatCalculAsynchronous function.
Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 2.
For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
Note For an efficient statistics calculation, it is necessary to perform this calculation on all data files (e.g. in the case of a multi-file query).
Example
// Statistiques sur la clé NomCli du fichier de données Client
Client.StatCalcule(NomCli)
Syntax
<Result> = <Source>.StatCalculate([<Key item> [, <Option>]])
<Result>: Boolean
  • True if the calculation was performed,
  • False if a problem occurred (data file locked by an application for example). HError is used to identify the error.
<Source>: Type corresponding to the specified source
Name of the data file used.
Warning: This data file must not be blocked by an application.
<Key item>: Optional character string
Name of the key item used to calculate statistics. If this name is not specified or if it is equal to "*", the statistics will be calculated for all key items found in the data file.
<Option>: Integer constant
Option for calculating the statistics.
  • If this parameter is not specified, the calculation of statistics locks the data file in write mode.
  • If this parameter corresponds to the hBackgroundTask constant, the statistics are calculated in background task, without locking the data file.
Important This parameter is only taken into account for HFSQL Client/Server data files. In the other cases, the data file is automatically locked while the statistics are calculated.
Remarks
  • <Source>.StatCalculate does not close the data file.
  • The statistics can also be updated by <Source>.Index. <Source>.Index and <Source>.StatCalculate can both be used to update the file statistics.
  • In the HFSQL Classic or Client/Server data files, the statistical calculation can only be performed on the key items.
  • The syntax <Source>.StatCalculate(<Data file>) is equivalent to <Source>.StatCalculate(<Data file>, "*")
  • To use <Source>.StatCalculate with the data files of an HFSQL cluster, the <Option> parameter must correspond to the hBackgroundTask constant to avoid locking the cluster.
Component: wd300hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help