> > I have this query I am tring to optimize, and I have trouble with a part of it. Perhaps someoine can shed some light.
> >
Select Project.* From Project Where Project.cprojno In (Select Data.cprojno From Data,;
> > param Where Param.cparamurn = Data.cparamurn ;
> > AND Not (Empty(Data.cparamdata) .And. ;
> > EMPTY(Data.mnotes) .And. Data.lprojspec = .F. .And.;
> > data.nquantity = 0 .And. Empty(Data.cbox1) .And. ;
> > EMPTY(Data.cbox2) .And. Empty(Data.cbox3) .And.;
> > EMPTY(Data.cbox4) .And. Empty(Data.cbox5) .And.;
> > EMPTY(Data.cbox6) .And. Empty(Data.cbox7) .And.;
> > EMPTY(Data.cbox8) .And. Empty(Data.cbox9) .And. ;
> > EMPTY(Data.cbox10) .And. Empty(Data.cbox11) .And. ;
> > EMPTY(Data.cbox12)) And Param.niddoctype = 0) ;
> > ORDER By Project.cprojno Into Cursor _2920FR6OG Readwrite
> >
> >
> > I seem to be getting a full optimization on the inner statement, but the outer one gives me aftyer listing all the indexes, it gives me a full optimization on the data table, the param table also has a full optimization, and so does the project table, which are the three tables used in the query. The last statemnent is :
> > "Rushmore optimaztion level for intermediate result : none"
> >
> > If any one can help.
> >
> >
> >
> > Mike Gagnon
> >
Refox XI +(English version) >
> Hi Mike,
> Instead of empty use values representing empty values for that field datatyep so it can utilize existing indexes. ie:
>
>
myNumField = 0
> myDate_Or_DT_Field = {}
> myCharField == ""
> !myLogical
>
> Second put fields that have indexes defined and/or likely to evaluate false-(with and)/true-(with or) in front in where clause to utilize VFP's shortcut feature.
>
> Something like:
>
Select Project.* From Project
> Where Project.cprojno In ;
> (;
> Select Data.cprojno ;
> From ('Data') dt ;
> inner join ('param') prm on prm.cparamurn = dt.cparamurn ;
> Where ;
> Prm.niddoctype = 0 and ;
> dt.nquantity = 0 And ;
> !Dt.lprojspec And ;
> Dt.mnotes == "" And ;
> Dt.cbox1 == "" And ;
> ... ;
> !(dt.cparamdata == "") ;
> ) ;
> ORDER By Project.cprojno ;
> Into Cursor _2920FR6OG ;
> Readwrite
>
> PS: Cursor name is a little hard to read sys15 value, I would use a menaingfull name:)
>
> Cetin Basoz
hi,
What would happen if the empty field would contain a Space ?
For example
Create cursor foo (f1 c(10))
Append blank
?'Empty status =' ,Empty(f1)
?'Comparision =' ,f1 == ""
suhashegde