Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does index tag on DELETED() help?
Message
De
10/11/2004 06:06:30
 
 
À
10/11/2004 02:46:10
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00958911
Message ID:
00959906
Vues:
8
>Hi Fabio,
>
>>In VFP9 beta not there is trace of this.
>
>There is, search for "FOR DELETED()" and you'll find the topic.
>
>
CREATE CURSOR test (test I)
>APPEND BLANK
>INDEX ON Test TAG TEST
>SET DELETED ON
>
>SYS(3054,2)
>
>SELECT * FROM Test WHERE Test = 1 NOFILTER
>
>SELECT Test
>DELETE TAG ALL
>
>INDEX ON Test TAG TEST FOR NOT DELETED()
>SELECT * FROM Test WHERE Test = 1 NOFILTER
>
>
>Walter,


Well, but the job it is not completed,
and this is't true for low level data operations,
VFP9 don't optimize the FOR clause !

VFPT it wants to abandon these commands?
SET DELETED ON
SET TALK OFF 
CLEAR 
CREATE CURSOR TESTDELETED (AA I DEFAULT RAND()*1000)
FOR k=1 TO 1000000
	APPEND BLANK 
	IF RAND()<0.5
		DELETE
	ENDIF
NEXT
? 'no index'
TRYTEST()
INDEX ON aa  TAG taa
? 'full index'
TRYTEST()
DELETE TAG ALL
INDEX ON aa  TAG taa FOR NOT DELETED()
? 'filtered index'
TRYTEST()

PROCEDURE TRYTEST
SET ORDER TO

t1=SECONDS()
  COUNT FOR aa<1
? _tally,SECONDS()-t1

t1=SECONDS()
 ? LOOKUP(AA,1,AA), SECONDS()-t1

T1=SECONDS()
SELECT COUNT(*) FROM TESTDELETED WHERE AA<1 INTO ARRAY DUMMY
? _tally,SECONDS()-t1
You can try this into VFP8,
a bug of the LOOKUP() function ( VFP don't check a FOR index condition )
allow FOR NOT DELETED() optimization before VFP9.

VFP it is now a confused programming environment,
if VFP9 RTM don't fixed this new design bug ( FOR optimization )
this increase the confusion.

No good.

Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform