Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to accelerate this query?
Message
De
30/03/2001 16:43:27
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00490429
Message ID:
00490465
Vues:
9
>I don't know about how much more you can optimize as long as you have indexes on Login.NoMember, Login.Creation, Member.Numero and Member.Mailing. I would use BETWEEN() function in the WHERE clause --
>
>WHERE BETWEEN(Member.Numero, lnNumberStart, lnNumberEnd) ...
>
>You could also test performance using 2 SQLs. First --
>
>SELECT NoMember, MAX(Creation) AS LoginCreation FROM Login WHERE Creation < Date() - 120 GROUP BY NoMember INTO CURSOR crsTEMP
>
>Then the second SQL would be
>
>Select MEMBER.*, crsTemp.LoginCreation INNER JOIN Member ON ...
>WHERE BETWEEN(Member.Numero, lnNumberStart, lnNumberEnd) ...

I don't have a tag on MEMBER.MAILING. However, I figure it wouldn't change that much as the MAILING field will be processed within the sub query of the between as those fields are indexed. I didn't create a tag on MAILING as I only use it occasionnaly in some special queries.

However, the biggest problem is to find the maximum CREATION value in the LOGIN table. This is where it slows down.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform