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
Allows you to handle the idle periods of a software (period without processes) to optimize the queries and the browses that will be run thereafter. Optimizes the access to the indexes of HFSQL Classic data files (the indexes of HFSQL Client/Server data files cannot be optimized).
Example
Customer.Optimize(Name)
Syntax
<Result> = <Source>.Optimize([<Key item>])
<Result>: Boolean
  • True if the file was optimized,
  • False if a problem occurs. HErrorInfo returns more details.
<Source>: Type corresponding to the specified source
Name of the HFSQL Classic data file used.
<Key item>: Optional character string
Name of the key item to optimize. If this parameter is not specified, <Source>.Optimize optimizes all the keys in the data file.
Remarks

Differences between HOptimize and HOptimizeQuery

  • <Source>.Optimize loads the system caches with the entire index of the data file. 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 overload, avoid calling <Source>.Optimize on a large number of data files or key items.
  • HOptimizeQuery loads the system caches with only the index parts needed for the specified query (for all the data files used by the query). This function is used to optimize the queries.

Miscellaneous

  • <Source>.Optimize immediately gives control back to the program and is run in the background.
  • <Source>.Optimize has no effect on non-key items or on data files that are not in HFSQL Classic format.
Component: wd300hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/06/2023

Send a report | Local help