Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select slow
Message
From
06/09/2006 02:33:49
 
 
To
30/08/2006 10:19:31
Suhas Hegde
Dental Surgeon
Sirsi, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01149759
Message ID:
01151206
Views:
32
If you have "where ..something.. and date=date(), then date() must be evaluated for every single record which matches the first where clause. So change
SELECT date,open,high,low,close,tottrdqty,sma9,sma12,sma26 FROM bhav_data;
where symbol = m.THISVALUE and date =date() INTO CURSOR tempDETAIL
into
ldDate=date()
SELECT date,open,high,low,close,tottrdqty,sma9,sma12,sma26 FROM bhav_data;
where symbol = m.THISVALUE and date =ldDate INTO CURSOR tempDETAIL
>hi,
>
>i have a free table
>
> create table bhav_data.dbf free ;
> (symbol c(20),series c(20),open f(20,2),high f(20,2),low f(20,2),close f(20,2),;
> last f(20,2),prevclose f(20,2),tottrdqty f(20,2),tottrdval f(20,2),;
> sma9 f(20,4),sma12 f(20,4),sma26 f(20,4),RSI f(20,2),ROC f(20,2),;
> timestamp c(20),date d,delqty i,delpercent f(20,2))
>
>index on symbol,date,series
>
>Total number of records 360128
>
>when i run
>
>
>SELECT date,open,high,low,close,tottrdqty,sma9,sma12,sma26 FROM bhav_data;
>where symbol == m.THISVALUE INTO CURSOR tempDETAIL nofilter
>
>this takes abt 3 secs to run
>
>same when
>
>set exact on
>SELECT date,open,high,low,close,tottrdqty,sma9,sma12,sma26 FROM bhav_data;
>where symbol = m.THISVALUE INTO CURSOR tempDETAIL nofilter
>
>---- this too takes 3 secs
>
>But
>
>set exact on
>SELECT date,open,high,low,close,tottrdqty,sma9,sma12,sma26 FROM bhav_data;
>where symbol = m.THISVALUE and date =date() INTO CURSOR tempDETAIL
>
>SELECT date,open,high,low,close,tottrdqty,sma9,sma12,sma26 FROM bhav_data;
>where symbol = m.THISVALUE INTO CURSOR tempDETAIL nofilter
>
>this both combined runs under 1 secs
>
>why ?
>
>and how can i run
>
>set exact on
>SELECT date,open,high,low,close,tottrdqty,sma9,sma12,sma26 FROM bhav_data;
>where symbol = m.THISVALUE INTO CURSOR tempDETAIL nofilter
>
>run under 1 sec ???
>
>TIA
>
>suhashegde
Previous
Reply
Map
View

Click here to load this message in the networking platform