wholeindex

WHOLE-INDEX found in xref on table [tablename]

Rule "wholeindex" scans the XREF file and gives this warning when it finds "WHOLE-INDEX".

This happens when you did not specify a WHERE-clause in your query, or a WHERE-clause with fields that
did not make it possible for Progress to set good index brackets.

The result can be that all records in [tablename] must be fetched and evaluated to check the WHERE-criteria. This is
bad for performance if there are many records in the table.

WHOLE-INDEX is not always slow. In the following example, Progress will report WHOLE-INDEX on the "FIND NEXT"
statement only because there is no WHERE-clause specified:

FIND customer WHERE customer.cust-num = 5 NO-LOCK NO-ERROR.
IF AVAILABLE customer THEN
   FIND NEXT customer NO-LOCK NO-ERROR.

In this particular example the FIND NEXT statement will perform pretty good despite the WHOLE-INDEX warning.


By the way, Prolint will also raise warning "no WHERE-clause used on customer" in this example (see rule nowhere).

Performance indicator:

  • on "wholeindex" and "nowhere", performance may not be so bad (but you should rewrite the statement anyway)
  • on "wholeindex" without "nowhere", performance is probably bad
  • on "sortaccess" and "nowhere", performance is probably horrible
  • on "sortaccess" plus "wholeindex" without "nowhere" performance is a potential nightmare.

the risc:

Possibly slow

how to solve this:

How to suppress these warnings:

Put directive {&_proparse_ prolint-nowarn(wholeindex)} in the source just before the line that causes the warning.

You might also use file "nowarn.lst" in directory prolint/settings or one of its subdirectories.
See also: suppress warnings.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

wholeindex

Just a comment about the way this is coded, that I found while fiddling with it today. The loop that reads the xref file is done with "do while true" instead of "repeat", and do blocks have a different endkey default handling, the result being that when it hits the end of the file it just returns. This doesn't keep it from providing the correct results, but it means that the stream closing statement, and any other code a fiddler such as myself might add to the end of the program, will never be executed.

-Tim Townsend