The view querying another view will have no optimization unless you have 
created the index tags on
the view cursor for all join keys. You can verify this by using SYS(3054).

You can create the index tags on the view after you open it (NODATA or not), or 
after the requery is
complete (test to see what is faster). The resulting CDX will disappear when 
you close the cursor,
so you have to create the index tags each time.

Rick
White Light Computing, Inc.

www.whitelightcomputing.com
www.swfox.net
www.rickschummer.com

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, January 22, 2008 06:37 PM
To: [EMAIL PROTECTED]
Subject: Can we speed up this query?

VFP9 no SPs, Win XP SP2, Windows Server 2003, VFP Database
All indexes exist for all fields involved in joins
CPDBF() for all tables =1252
set('collate')=machine

This is a view that is used by another view. This view in the coverage profiler
can take 30-40 seconds to run.

SELECT Ordprod.orderid, Ordsize.orderprodid,;
  SUM(Ordsize.ordered) AS totordered,;
  SUM(Ordsize.allocated) AS totallocated,;
  SUM(Ordsize.shipped) AS totshipped, Ordhead.sbo AS specialord;
 FROM ;
     Ordsize ;
    INNER JOIN ordprod ;
   ON  Ordprod.orderprodid = Ordsize.orderprodid ;
    INNER JOIN ordhead ;
   ON  Ordprod.orderid = Ordhead.orderid;
 GROUP BY Ordsize.orderprodid, Ordprod.orderid, Ordhead.sbo

Any ideas on speeding it up?

TIA,
Mike



--------------------------------------------------------------------
This mail sent through WebMail | Courtesy of Execulink



[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to