Walter Meester
HoogkarspelPays-Bas
>Edward,
>
>>If I will tell you what I really think about SET RELATION, I wonder that you take it as personal offense, so I would just stay within well-known fact that SET RELATION just mask on SEEK() behind the scene, so it cannot be faster.
>
Try this code fragment and you be able to verify that SET RELATION
is indeed faster. When opening the data each time the results on
my P-400 running NT 4.0 were as follows:
SET RELATION - .094 (faster)
SEEK - .110
without opening the data tables
SET RELATION - .062 (about twice as fast!)
SEEK - .125
notice that i ran the set relation first to give the seek
routine an advantage of priming the index tags...
The proof is in the benchmark.
*!* clos data all
*!* clea all
*!* clear
*!* open database tastrade
*!* use orders in 0 order order_id shared
*!* sele 0
*!* use order_line_items
lncnt = 0
lnst = seco()
set rela to order_id into orders
SCAN
IF NOT EOF('orders')
lncnt = lncnt + 1
ENDIF
ENDSCAN
@ 1,1 say 'SET RELATION Results:'
@ 2,1 say lncnt
@ 3,1 say seco() - lnst
lncnt = 0
lnst = seco()
scan
if seek(order_id,'orders')
lncnt = lncnt + 1
endif
endscan
@ 6,1 SAY 'SEEK results:'
@ 7,1 say lncnt
@ 8,1 say seco() - lnst
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement