Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper index for date field
Message
De
22/01/2006 11:00:22
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
22/01/2006 10:40:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01089204
Message ID:
01089213
Vues:
33
>Hi Jim,
>
>Yes, I am opening the view with NODATA.
>
>I only have a handful of deleted records and NO I do not have a tag on DELETED().
>
>If I add the index as expression = TTOC(xxx,1) or DTOS() would I not need to make the same changes to the where clause, or does it matter?
>
>TTOC(Account_debits.dtxndatetm,1) >= ttoc(DATETIME()-432000,1);
>
>Do the index expr and the use of it in the view not have to be in sync with each other for optimization? That is probably the part I do not "get".

They do. Specifically the use of it on the left of the operator has to match the index expression. The right side should be a constant, especially since datetime will return different values every second.

lcTTOC = ttoc(DATETIME()-432000,1)
select ...
where TTOC(Account_debits.dtxndatetm,1) = m.lcTTOC

>
>Thanks,
>John
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform