Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>set optimize:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  SET OPTIMIZE:

  Syntax:

  SET OPTIMIZE ON/OFF/<lExp>

  ON sets automatic optimization of Mach SIx supported commands.  This
  is the default.

  OFF overrides automatic optimization and defaults to standard
  Clipper processing.

  <xlToggle> is a logical expression that must be enclosed in parentheses.
  A value of true (.T.) is the same as ON, and a value of false (.F.) is
  the same as OFF.

  Description:

  The SET OPTIMIZE command is used to disable automatic optimization of all
  Mach SIx supported commands.  This command is useful for comparing
  your applications query performance with and without Mach SIx.  You can
  also turn off optimization for selected commands by specifying the
  NOOPTIMIZE clause in the syntax for the command.

  ---------------------------------| EXAMPLE |--------------------------------
  /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  *  Demonstrates the SET OPTIMIZE command.                                 *
  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/

  #include "SIXCDX.CH"
  #include "MACHSIX.CH"

  Local nCount, nStart, nTime

  USE Account VIA "SIXCDX"

  SET INDEX TO State       //  State could be a tag in a .CDX

  ? "Example of SET OPTIMIZE command."
  ?

  //..........................set order to 0 for optimal query performance
  SET ORDER TO 0

  //.......................................turn off automatic optimization
  SET OPTIMIZE OFF

  nStart := seconds()
  COUNT TO nCount FOR State = "CA"
  nTime  := seconds() - nStart

  ? "Whoah that was slow!"
  ? "Time to count   = " + alltrim( str( nTime ) )
  ? "Records counted = " + alltrim( str( nCount ) )

  //....................................re-activate Mach SIx optimization
  SET OPTIMIZE ON

  nStart := seconds()
  COUNT TO nCount FOR State = "CA"
  nTime  := seconds() - nStart

  ? "Poof!"
  ? "Time to count   = " + alltrim( str( nTime ) )
  ? "Records counted = " + alltrim( str( nCount ) )


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson