In case you weren't aware that NOT EMPTY appears to be unable to use Rushmore optimization...

There is a regular index on the order.srep field.  I added the SETs to emulate the environment per legacy code.

The results are why I changed the original author's NOT EMPTY(field1) SQL to field1 <> "" instead:

CLEAR
OPEN DATABASE c:\temp\test SHARED
SET ANSI OFF
SET EXACT OFF
SET NEAR ON
LOCAL lcOpt as String
? SYS(3054,12,"lcOpt")

SELECT distinct srep FROM test!order WHERE srep <> "" INTO CURSOR crap

#IF .F.
    Results:
    SELECT distinct srep FROM test!order WHERE srep <> "" INTO CURSOR crap
    Using index tag Srep to rushmore optimize table order
    Rushmore optimization level for table order: partial
#ENDIF

SELECT distinct srep FROM test!order WHERE NOT EMPTY(srep) INTO CURSOR crap

#IF .F.
    Results:
    SELECT distinct srep FROM test!order WHERE NOT EMPTY(srep) INTO CURSOR crap
    Rushmore optimization level for table order: none
#ENDIF


--
Michael J. Babcock, MCP
Fox/VFP dev since 1997
Developer of FabNet estimating software - mbsoftwaresolutions.com


_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/2208c725-f366-9e6a-b0d4-ae5417770...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to