Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UDF's second rate citizen in Rushmore ?
Message
From
19/09/2006 13:29:59
 
 
To
19/09/2006 12:56:52
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01151219
Message ID:
01155176
Views:
53
>>T1=SECONDS()
>>? "BAD: this uses TFF1 and is optimized"
>>SELECT count(FF) FROM ALIAS() INTO ARRAY AX
>>? SECONDS()-T1
>
>Does it really make use of TFF1? optimizing Count() can be done if rushmore sees, that the count() is equal to reccount(). Due To SET DELETED OFF that is valid, as there is no filter in effect. So I think this time rushmore in fact uses the reccount() stored in the table header to optimize the query, not an index.
>
>Bye, Olaf.

You are correct, but it still BAD because RECCOUNT() is an optimization also it:
CREATE CURSOR cc (ff i)
DIMENSION AX[1000000,1]
APPEND FROM ARRAY AX
INSERT INTO cc VALUES (2)

CLEAR

SET DELETED OFF
T1=SECONDS()
* THIS uses RECCOUNT()
COUNT
? SECONDS()-T1

T1=SECONDS()
* THIS don't uses RECCOUNT()
CALCULATE CNT()
? SECONDS()-T1

T1=SECONDS()
* THIS uses RECCOUNT()
SELECT count(*) FROM ALIAS() INTO ARRAY AX
? SECONDS()-T1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform