Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT-SQL optimization
Message
De
09/04/2008 14:22:18
 
 
À
09/04/2008 14:17:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01309469
Message ID:
01309473
Vues:
11
>Here's my SELECT-SQL query:
SELECT HistContact.PK_HistContact, HistContact.FK_HistRec;
>    FROM HistContact;
>    INNER JOIN HistRec ON HistRec.PK_HistRec == HistContact.FK_HistRec;
>    INNER JOIN HistFile ON HistFile.PK_HistFile == HistRec.FK_HistFile;
>    INNER JOIN HistDocket ON HistDocket.PK_HistDocket == HistFile.FK_HistDocket;
>    WHERE (HistContact.FCC == "ABARJ329395001") AND (HistDocket.Docket == "9999") AND (HistFile.OutputType == "M")
Table HistContact have indexes on those fields:
>- FK_HistRec
>- FCC
>
>Table HistRec have indexes on those fields:
>- PK_HistRec
>- FK_HistFile
>
>Table HistFile have indexes on those fields:
>- PK_HistFile
>- FK_HistDocket
>- OutputType
>
>Table HistDocket have indexes on those fields:
>- PK_HistDocket
>- Docket
>
>Here's the output of SYS (3054, 11):
Using index tag Fcc to rushmore optimize table histcontact
>Rushmore optimization level for table histcontact: partial
>Rushmore optimization level for table histrec: none
>Using index tag Outputtype to rushmore optimize table histfile
>Rushmore optimization level for table histfile: partial
>Using index tag Docket to rushmore optimize table histdocket
>Rushmore optimization level for table histdocket: partial
>Joining table histdocket and table histfile using index tag Fk_histdoc
>Joining table histcontact and table histrec using index tag Pk_histrec
>Joining intermediate result and intermediate result using temp index
I guess the partial optimisation from tables HistContact, HistFile and HistContact is because I have no DELETED () index on these tables and it's OK.
>
>HistRec show no optimisation and I guess it's OK since I have no conditions on this table. It's only part of the join clause.
>
>What bother me is the last line:
Joining intermediate result and intermediate result using temp index
Why it's not using the indexes PK_HistFile and FK_HistFile to join the tables HistFile and HistRec?
>
>Is there any way I can optimise further this query?
>
>TIA

It does not like == operator. Try to use =.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform