VFP 9 SP2
Server 2003
4GB Ram
Local Disk
Dual Xeon 3Ghz
FMRComMaster has 10 records
IID I AutoInc indexed
ComDate D Index
plus few more fields
FMRCom has 2,137,895 records (2 mil)
IID I AutoInc Indexed
SIM C(20) Indexed
CustNo C(10) Indexed
fk_FMRComMast I Indexed
plus other fields
ARCust has about 4000 records
CustNo C(10) Indexed
plus other fields
Query 1 takes .35 seconds on local machine.. about 3-5 seconds on Network station over 1GB LAN
Query 2 takes about 4 seconds on local machine, and 30+ seconds on network station (same station)...
I need to be able to pull date ranges and when i switched to Query 2, its crawling now..
is there any way i can make it faster?
Ali Koumaiha
TeknoSoft Inc.
Michigan
Server 2003
4GB Ram
Local Disk
Dual Xeon 3Ghz
FMRComMaster has 10 records
IID I AutoInc indexed
ComDate D Index
plus few more fields
FMRCom has 2,137,895 records (2 mil)
IID I AutoInc Indexed
SIM C(20) Indexed
CustNo C(10) Indexed
fk_FMRComMast I Indexed
plus other fields
ARCust has about 4000 records
CustNo C(10) Indexed
plus other fields
Query 1 takes .35 seconds on local machine.. about 3-5 seconds on Network station over 1GB LAN
Code:
close DATABASES all
clear ALL
CD d:\ezcellerp\data
USE fmrcom in 0
USE fmrcommaster in 0
lnSec = SECONDS()
ldStart = CTOD('01/01/2012')
ldEnd = CTOD("01/01/2012")
SELECT ;
FMRCom.Sim,;
FMRCom.PIN,;
FMRCom.Account,;
FMRCom.MSISDN,;
FMRCom.ActDate,;
FMRCom.STATUS,;
FMRCom.UsedDate,;
FMRCom.VALUE AS CardValue,;
FMRCom.CustNo,;
ARCust.company,;
ARCust.Repname,;
FMRCom.Royalty,;
FMRCom.PayAmount,;
FMRComMaster.ComDate AS ComDate;
FROM FMRCom ;
LEFT OUTER JOIN FMRComMaster ;
ON FMRCom.fk_FMRComMast = FMRComMaster.IID ;
LEFT OUTER JOIN ARCust ;
ON FMRCom.CustNo = ARCust.CustNo ;
WHERE fk_FMRComMast = 38 ;
ORDER BY FMRCom.CustNo,FMRCom.UsedDate ;
into cursor curFMRDetail
messagebox(SECONDS() - lnSec)
Query 2 takes about 4 seconds on local machine, and 30+ seconds on network station (same station)...
Code:
close DATABASES all
clear ALL
CD d:\ezcellerp\data
USE fmrcom in 0
USE fmrcommaster in 0
lnSec = SECONDS()
ldStart = CTOD('01/01/2012')
ldEnd = CTOD("01/01/2012")
SELECT ;
FMRCom.Sim,;
FMRCom.PIN,;
FMRCom.Account,;
FMRCom.MSISDN,;
FMRCom.ActDate,;
FMRCom.STATUS,;
FMRCom.UsedDate,;
FMRCom.VALUE AS CardValue,;
FMRCom.CustNo,;
ARCust.company,;
ARCust.Repname,;
FMRCom.Royalty,;
FMRCom.PayAmount,;
FMRComMaster.ComDate AS ComDate;
FROM FMRCom ;
LEFT OUTER JOIN FMRComMaster ;
ON FMRCom.fk_FMRComMast = FMRComMaster.IID ;
LEFT OUTER JOIN ARCust ;
ON FMRCom.CustNo = ARCust.CustNo ;
WHERE BETWEEN(FMRComMaster.ComDate,ldStart,ldEnd) ;
AND FMRCom.PayAmount <> 0 ;
ORDER BY FMRCom.CustNo,FMRCom.UsedDate ;
into cursor curFMRDetail
messagebox(SECONDS() - lnSec)
I need to be able to pull date ranges and when i switched to Query 2, its crawling now..
is there any way i can make it faster?
Ali Koumaiha
TeknoSoft Inc.
Michigan