Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>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
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