Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Mach SIx v1.1c - Reference Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  Can I optimize queries using relationships?:

  Relationships can be optimized in two ways by Mach SIx.

    1. You can list the aliased expression in a FOR condition that contains
       at least one indexed expression on the parent table.  The expression
       can be partially optimized by Mach SIx.  See the following example.

       SELECT Payment

       SET INDEX to PayCode

       COUNT TO nCount FOR  PayCode = "CASH" .and. Account->State = "CA"
                            =======                ---------------------

       // ==== Key expression of PayCode index, built on Payment table
       // ---- related expression from Account table

    2. You could build an index on the related field while in the parent
       table.  This will result in a fully optimizable Mach SIx query.
       See the following example.


       SELECT Payment

       INDEX ON Account->State TO Temp

       SET INDEX to PayCode, Temp

       COUNT TO nCount FOR  PayCode = "CASH" .and. Account->State = "CA"
                            =======                ---------------------

       // ==== Key expression of PayCode index, built on Payment table
       // ---- Related key expression, built on Payment, from Account table



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