ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Differences between HOptimize and HOptimizeQuery
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Optimizes the Select queries by using idle times when handling an application (period without processes). Optimizes the access to the indexes of HFSQL Classic data files.
Example
HOptimizeQuery(QRY_Customer, 34)
Syntax
<Result> = HOptimizeQuery(<Query name or SQL code> [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Boolean
  • True if the data file was optimized,
  • False if a problem occurs. HErrorInfo returns more details.
<Query name or SQL code>: Character string
  • Logical name of the query used (Select query only).
  • SQL code of the query used (Select query only).
<Parameter 1>: Optional parameters (the type corresponds to the parameter type)
Values of the parameters expected by the query in order of initialization (visible in the query editor). Each parameter must correspond to the expected type. The different parameters are separated by a comma.
The query parameters can also be passed before HOptimizeQuery using the following notation: <QueryName>.<ParameterName> = <Value>.
The parameters are ignored if "<Query name or SQL code>" corresponds to the SQL code of the query used.
<Parameter N>: Optional parameters (the type corresponds to the parameter type)
Values of the parameters expected by the query in order of initialization (visible in the query editor). Each parameter must correspond to the expected type. The different parameters are separated by a comma.
The query parameters can also be passed before HOptimizeQuery using the following notation: <QueryName>.<ParameterName> = <Value>.
The parameters are ignored if "<Query name or SQL code>" corresponds to the SQL code of the query used.
Remarks

Differences between HOptimize and HOptimizeQuery

  • HOptimize loads the system cache with the entire file index. There is a risk of overloading the system caches if the data file is very large or if the application uses several large data files.
    To avoid the risk of saturation, avoid calling HOptimize on too many data files or key items.
  • HOptimizeQuery loads the system caches with only the index sections required by the specified query, for all the data files used by the query. This function is used to optimize the queries.

Miscellaneous

  • HOptimizeQuery immediately gives control back to the program and is run in the background.
  • To avoid the risk of overload, avoid calling HOptimizeQuery on a large number of requests.
  • If an optimization is in progress when HOptimizeQuery is called, the current optimization is automatically stopped.
Business / UI classification: Business Logic
Component: wd300hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/04/2024

Send a report | Local help