PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

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
Reorganizes the internal structure of the indexes to optimize the speed for accessing the data. Based on HStatCalculate, this function performs several statistical calculations on the keys of a data file.
When should HAccelerateSpeed be used?
This function can be used as often as necessary but we advise you to use it after a set of additions (in most cases, after a set of additions corresponding to at least 1 per thousand of the number of records in the database).
Note: In order for the statistical calculation to be efficient, this calculation must be performed on all data files (for a multi-file query for example).
Caution: This function must not be systematically used in the initialization code of the project. Indeed, optimizing the speed for accessing the data may take quite a long time and the users may be slowed down.
How does HAccelerateSpeed operate?
The statistics on the keys of a data file are used when implementing a filter, when creating a query or when creating a view on the data file. The HFSQL engine analyzes the selection condition then it is using these statistics to define the most discriminating items that will be used to optimize the browse operations performed on the data files.
The statistics are used to get information about the content of the data file when they are calculated. Once the statistics have been calculated:
  • The more the data file is modified, the less accurate the statistics are.
  • The more records the data file contains, the less the modification of a single record impacts the overall statistics.
Caution: HAccelerateSpeed locks the data file in write mode when the statistics are calculated (a file browse is performed for each file key).
HFSQL Client/Server The statistics can be calculated in background task without locking the data file in write mode.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Example
// Reorganizes the Customer file on the CustName key
HAccelerateSpeed(Customer, CustName)
Syntax
<Result> = HAccelerateSpeed([<File Name> [, <Name of Key Item> [, <Optimization>]]])
<Result>: Boolean
  • True if the reorganization of indexes was performed,
  • False if a problem occurred (file locked by an application for example). HError is used to identify the error.
<File Name>: Optional character string (with or without quotes)
Name of data file used. If this name is not specified, HAccelerateSpeed handles the last data file used by the last function for HFSQL management (starting with the letter H).
If this parameter is equal to "*" (without specifying any item), the operation will be performed on all the data files described in the current analysis (including the data files described by HDeclare, HDeclareExternal, HDescribeFile).
Caution: This data file must not be locked by an application.
<Name of Key Item>: Optional character string (with or without quotes)
Name of the key item used to reorganize the indexes. If this name is not specified or if it is equal to "*", the reorganization of indexes will be performed on all the key items of the data file.
<Optimization>: Integer constant
HFSQL Client/Server Used to optimize the reorganization of indexes for the HFSQL Client/Server files.
If this parameter is not specified, the data file used will be locked in write mode.
If this parameter corresponds to the hBackgroundTask constant, the reorganization of indexes will be performed in background task, without locking the data file.
Important: This parameter is taken into account for the HFSQL Client/Server files. In the other cases, the file is automatically locked when the statistics are calculated.
Remarks
  • HAccelerateSpeed does not close the data file.
  • The reorganization of indexes can also be performed by HIndex or by HStatCalculate.
  • In the HFSQL Classic or Client/Server data files, the reorganization of indexes can only be performed on the key items.
  • HAccelerateSpeed(<File Name>) is equivalent to HAccelerateSpeed(<File Name>, "*")
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Linux wd230hf.so
Minimum required version
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment