Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexed date field
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00341249
Message ID:
00341280
Views:
19
>Is there a performance difference in creating an index on a date field as such?
>
>1) index on date tag date
>2) index on dtoc(date) tag date
>3) index on dtos(date tag date

>Yep. Number 1 is the way to go unless the index is compound and the other field is a string. This is because the others require a function to be evaluated >each time the index is re-built or a record is added.

>Number two should be avoided since you probably won't get the records in the order that's desired. Unless the optional 1 parameter is added, the result of >the function will be MM/DD/YYYY (unless SET DATE is set to something different than AMERICAN or MDY).

>Number three will return a string in the format of YYYYDDMM (the same as DTOC(date, 1)), but should be only be used when the index expression >contains multiple string fields.

Thanks for your confirmation.
HI-YO SILVER AWAY!!
The Lone Ranger, The late Clayton Moore R.I.P.
I am a fool!
Previous
Reply
Map
View

Click here to load this message in the networking platform