Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL LIKE and Rushmore optimization
Message
De
20/01/2006 10:24:10
 
 
À
20/01/2006 09:28:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01088808
Message ID:
01088910
Vues:
19
This message has been marked as a message which has helped to the initial question of the thread.
>Hello Fabio,
>Thanks for response.
>
>Very interesting
>
> exist an index cexp with collate MACHINE
>LEFT('cstring',1)<>'%' OR '_'
>
>
>I have next simple SQL
>
>SELECT * FROM table WHERE UPPER(description) like "HP%DRUCKER" INTO CURSOR _resultset
>
>I check - no "%" and no "_" as LEFT(description,1) present
>I set SYS(3054,1,"lcOptimizeLevel")
>Execute SQL
>I'v got next result
>Using index tag descr1 to rushmore optimize table
>Using index tag deleted to rushomre optimize table
>Rushmore optimization level for table : Partial !!
>
>Why "partial" ? Difficult to understand.. Index Expression - Ok.. no "%","_"..
>
>SELECT * FROM table WHERE UPPER(description)="HP" INTO CURSOR _resultset
>
>returns "FULL"..
>
>But so far as I know.. LIKE supports rushmore optimization... whats wrong?
>
>Denis
>
>
Hi Denis, none is wrong.
VFP8SP1 have a bug on SYS(3054), and return 'partial' with every optimizable LIKE

this is fixed on VFP9SP1, and this explain
CREATE CURSOR TESTLIKE (CC C(200))
APPEND BLANK
REPLACE CC WITH ' Y  C'
INDEX ON CC COLLATE 'MACHINE' TAG T1


CLEAR

SYS(3054,12)
SET DELETED OFF
TEST()

SET DELETED ON
*
TEST()

DELETE TAG ALL

INDEX ON CC COLLATE 'MACHINE' FOR NOT DELETED() TAG T2
SET DELETED OFF
TEST2()

SET DELETED ON
*
TEST2()

PROCEDURE TEST

SELECT * FROM TESTLIKE WHERE CC LIKE 'X' INTO ARRAY AA&& DELETE OFF = 'Full'  ON = 'Partial'

SELECT * FROM TESTLIKE WHERE CC LIKE 'X%' INTO ARRAY AA && DELETE OFF = 'Full'  ON = 'Partial'

SELECT * FROM TESTLIKE WHERE CC LIKE 'X%C' INTO ARRAY AA && DELETE OFF = 'Partial'  ON = 'Partial'

PROCEDURE TEST2

SELECT * FROM TESTLIKE WHERE CC LIKE 'X' INTO ARRAY AA && DELETE OFF = 'none'  ON = 'Full'

SELECT * FROM TESTLIKE WHERE CC LIKE 'X%' INTO ARRAY AA && DELETE OFF = 'none'  ON = 'Full'

SELECT * FROM TESTLIKE WHERE CC LIKE 'X%C' INTO ARRAY AA && DELETE OFF = 'none'  ON = 'Partial'
'partial' it means that VFP doesn't complete the selection through an AND on the indexes,
but it has to make other comparisons in the record
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform