Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimizing a View/SQL-Select
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00443643
Message ID:
00444076
Vues:
9
>>Try using a SELECT on Orders and OrderItems only with a function reference to get the supplier code id. The function should do a seek on Supplier.Sup_Id and return Supplier.Code.
>>

>
>Peter, I think I did that already.....did you overlook this section of my original post or am I still missing something?

I looked at that and yes that only involves 2 tables at a time. But it does require two separate queries. What I am suggesting would be only one query with two tables. If you run out of other things to try, perhaps you could try this.

Peter





>If I split it into two it still takes about 2 minutes
>
>Even this short one takes 35 seconds
>
>SELECT orders.*, ;
> Orderitems.* ;
> FROM ofax!orders INNER JOIN ofax!orderitems ;
> ON Orders.order_id = Orderitems.order_id ;
> INTO CURSOR temp
>
>
>SELECT Temp.order_id_a, ;
> Temp.order_date, ;
> Temp.closed, ;
> Temp.ofaxclnum, ;
> ALLTRIM(Temp.last_name)+", "+ALLTRIM(Temp.first_name) AS subject, ;
> Temp.report_nam, ;
> Temp.order_po, ;
> Supplier.code, ;
> Temp.descriptio, ;
> Temp.city, ;
> Temp.state, ;
> Temp.county, ;
> Temp.reply, ;
> Temp.summary, ;
> Temp.status_b, ;
> Temp.user_id_b, ;
> Temp.report_num, ;
> PADL(ALLTRIM(Temp.report_num),LEN(Temp.report_num),"0") AS rpt_num ;
> FROM Temp INNER JOIN ofax!supplier ;
> ON Temp.sup_id = Supplier.sup_id ;
> ORDER BY temp.ofaxclnum, rpt_num, temp.report_num
Peter Robinson ** Rodes Design ** Virginia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform