On 9/11/2012 9:35 PM, Sytze de Boer wrote:
> I'm losing my mind over this
>
> At a client site, they run a report which can take 30 mins to generate,
> over the network
> When they run it on a local pc, it takes 5 secs
>
> Without boring you with all the details, essentially, the following code
> makes up the report
> *trcask4=a date
> *trcask5=a date
>
>     Select Date,stockcode,stktype,invnum,qty,ttlamount,disc,ppb,cost,Desc,
> "H" As SRCE From winhst   Where Between(Date,trcask4,trcask5) Union All;
>     Select Date,stockcode,stktype,invnum,qty,ttlamount,disc,ppb,cost,Desc,
> "I" As SRCE  From wininvs  Where Between(Date,trcask4,trcask5) Union All ;
>     Select Date,stockcode,stktype,invnum,qty,ttlamount,disc,ppb,cost,Desc,
> "J" As SRCE From wintime  Where Between(Date,trcask4,trcask5) Into Table
> (myfile)
>
> The Winhst file has about 500,000 records
> The other 2 less than a 1000 combined
>
> There seems to be a big difference in time if no-ones else has logged into
> the app from a different workstation
>
> Can anyone suggest a way to make this go quicker?


What happens if you use "DATE BETWEEN trcask4 and trcask5" instead of 
using VFP's BETWEEN function?  iirc, BETWEEN(field,arg1,arg2) was NOT 
optimizable but "field BETWEEN arg1 and arg2" was optimizable.

hth,
--Mike



-- 
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16

_______________________________________________
Post Messages to: ProFox@leafe.com
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/5050b7af.1000...@mbsoftwaresolutions.com
** 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