Learn More
Search site for:
News »
Scroll Up for Recent News
ASI Launches new Beta Progam
Appx Software, Inc has launched a new beta program ...

[Read Full Article]


Appx 5.0 Released!
The long awaited Release 5 of Appx is available ...

[Read Full Article]


Appx 5.0 Beta for Windows is Ready!
The Windows version of Appx Release 5.0 Beta is ready...

[Read Full Article]


Appx 5.0 Linux Beta is Ready!
Appx Release 5.0 Beta is ready. This Release includes ...

[Read Full Article]


Caylx Retires from Distribution
Following 33 years of working with the SPEED I, SPEED II and APPX...

[Read Full Article]


Appx Blog
Appx Blog Online
ASI has started a blog! This is an excellent way...

[Read Full Article]


Appx Conference 2007
We're pleased to report that our first European APPX Conference proved to be...

[Read Full Article]


Appx Conference 2007
Still haven't decided if the Appx Conference is for you? First of all, it's a great way...

[Read Full Article]


CWI Hosts European Conference
For some years now, ASI has been hosting tremendously successful APPX conferences in the USA...

[Read Full Article]


4.2.a Patch
ASI announces the APPX 4.2.a Patch Release is now available for download ...

[Read Full Article]


New Registration Format
ASI provides a new format for emailed APPX registrations. Registrations are now being sent as text file attachments to...

[Read Full Article]


Conference Results
Another conference is over, and once again it provided an excellent opportunity to network, learn and socialize with VARs and customers from around the world...

[Read Full Article]


Appx Conference
You are cordially invited to join your APPX colleagues and friends at the newest "episode" of the bi-annual conference, called "APPX EX-ZOO-BERATION 2006"!...

[Read Full Article]


Minicom Joins CWI
CWI is delighted to welcome Minicom Software House Ltda, located in Brazil, to its reseller network!

For over 25 years, Minicom's team of consultants has been involved in the development and...

[Read Full Article]


Sadden Joins CWI
Sadeen Computerized Systems is an integrated solutions provider which has been offering management control software, security systems and access control software to SMEs for a number of years. Now, however...

[Read Full Article]


SWS Joins CWI
CWI is pleased to welcome SWS Software Service in Austria to its reseller network! SWS has been a very successful SPEED II reseller since 1983 and has been working with APPX since...

[Read Full Article]


Sintec Joins CWI
CWI is pleased to welcome Sintec, S.A. de C.V. from Mexico to its reseller network!

[Read Full Article]


Scroll Down for Archived News


A | B | C | D | E |F | G | H | I | J | K | L | M | N | O | P
Q | R | S | T | U | V | W | X | Y | Z


Boosting Query Speed

Background: When an APPX query is run, 2 memory files are created to store the information about what fields to sort on and what fields to select on. These are the QSORT and QSLCT files respectively. Bruce's approach is to read these files to see if a particular non PCF file is required, and if not, completely skip the overhead of reading the associated records. In Bruce's example, he is checking to see if the DAR CUSTOMER file is used in the query (for either sorting or selecting) before going through the overhead of reading the DAR CUSTOMER table.

Here's Bruce's tip:

Create three domains in your main app, for example:

WORK QSLCT ACTV      LOGIC y/n
WORK QSLCT APP         ALPHA X(3)
WORK QSLCT FLD         ALPHA X(22)
Now create three work variables in your main app, for example:

WORK TEST QSLCT ACTV     DOMAIN y/n
WORK TEST QSLCT APP         DOMAIN X(3)
WORK TEST QSLCT FLD         DOMAIN X(22)
Use the domains you defined in the first step. Mine are subprocess 'cause I use them all within the same process but yours might have to be RELATED of even DETACHED. Here's the main subroutine that I use called TEST FOR ACTIVE QSLCT ENTRIES:

    SET      DTR WORK TEST QSLCT ACTV     = 0
    BEG READ --- QSLCT HOLD 0 KEY IS QSLCT KEY
    IF       --- QSLCT ACTV EQ 1
T   IF       --- QSLCT AP ID L         EQ DTR WORK TEST QSLCT APP
T   AND      --- QSLCT FLD NAM L       IN DTR WORK TEST QSLCT FLD
TT  IF       --- TEXT AT POSITION      EQ 1
TTT SET      DTR WORK TEST QSLCT ACTV  =  1
TTT GOTO     :EXIT QSLCT READ LOOP
    END READ --- QSLCT
    LABEL    :EXIT QSLCT READ LOOP
It simply reads through the runtime 0LA QSLCT file searching for an Active entry for AP ID L and FLD NAM L in question. Active entries are those that had non-blank specs AFTER the user was through with them. DANGER: I assume that only ONE query is being invoked at a time in the current job. You would have to add two more work fields WORK QRY AP and WORK QRY NAM to distinguish between more than one.

Now define a work variable like WORK QSLCT ON CUSTOMER, DOMAIN y/n pointing back to the logical domain in your main app. Next, create a subroutine called TEST FOR QSLCT ON CUSTOMER with the following but with your specific info:

SET   DTR WORK TEST QSLCT APP    = DAR
SET   DTR WORK TEST QSLCT FLD    = CUSTOMER
GOSUB DTR TEST FOR ACTIVE QSLCT ENTRIES
SET   DAR WORK QSLCT ON CUSTOMER = DTR WORK TEST QSLCT ACTV
This routine sets the 2 work fields to tell the TEST FOR ACTIVE QSLCT subroutine which application and file name we are interested in. Finally, in any START OF QRY EXECUTION put in

COPY DAR TEST FOR QSLCT ON CUSTOMER
It is essential that this be a COPY, as nested GOSUBs within Start of Query Execution can cause problems in APPX 3.5 - 4.05. This routine will set the DAR WORK QSLCT ON CUSTOMER field to tell whether or not the CUSTOMER file was used in the Record Selection Screen of the Query. What I do is something like the following in Pre-User Selection

    IF   DAR WORK QSLCT ON CUSTOMER EQ 1
    AND  DAR CUSTOMER NO            NE DSA SALES CUSTOMER NO
T   SET  DAR CUSTOMER NO            EQ DSA SALES CUSTOMER NO
T   READ DAR CUSTOMER KEY IS CUSTOMER NO
This means that I ONLY read the secondary file CUSTOMER if I'm selecting on a field in DAR whose name starts with "CUSTOMER" AND the value of the DSA SALES CUSTOMER NO has just changed. Note that this is most useful if you've followed the APPX standards suggestions and have all of the fields within a file start with the filename itself... :-)

So far, we have only dealt with checking to see if a field was used on the Record Selection Screen. We also need to check if the field was included in the sort via the Sort Order screen. Go through from the beginning and design transfer and replace all QSLCT with QSORT. In the Post-User Selection Event Point, put the following code:

    IF   DAR WORK QSORT ON CUSTOMER EQ 1
    AND  DAR WORK QSLCT ON CUSTOMER EQ 0
    AND  DAR CUSTOMER NO NE DSA SALES CUSTOMER NO
T   SET  DAR CUSTOMER NO EQ DSA SALES CUSTOMER NO
T   READ DAR CUSTOMER KEY IS CUSTOMER NO
Here we first test to see if the user is sorting on a field in the CUSTOMER file, and if so, we further check to see if they also selected on it. If they selected on a field from CUSTOMER, we don't have to read the record here as we already read it in the Pre-User Selection. If they didn't select on it, but they are sorting on it, then we need to read the CUSTOMER file here.

Now all of my large Queries only read "secondary" files when necessary.

« Return




For additional information, contact tips@cwi-appx.com

[back to top]