This was the prologue to the SET ANSI OFF thread.  When I changed for optimization's sake (because the customer had complained that the original code was very slow), I got 0 results due to the legacy code having SET ANSI OFF.

On 5/11/2021 8:47 PM, MB Software Solutions, LLC wrote:
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/0c5505b0-c475-b0c9-4ffd-65500be10...@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