Hi Fabio,
I got completely different result from yours in VFP9 RTM(2412). The time for both queries is roughly the same
Rushmore optimization level for intermediate result: none
Rushmore optimization level for intermediate result: none
Joining intermediate result and intermediate result using temp index
0.177 98200
Rushmore optimization level for intermediate result: none
Rushmore optimization level for intermediate result: none
Joining intermediate result and intermediate result using temp index
0.179 98200
>This have a hard impact for a WHERE filtering,
>but on a join ( or multijoin !) this put VFP into this class:
>"Customer use task manager for kill me please"
>
>Try this on VFP8 and VFP9
>
>CLEAR
>SET TALK OFF
>SET ANSI OFF
>SYS(3054,11)
>CLOSE TABLES all
>SYS(1104)
>
>#DEFINE lnMaxKeys 10
>#DEFINE lnMaxRec 10000
>CREATE CURSOR lossitem ( Lit_LosFK C(10))
>FOR i=1 TO lnMaxRec
> INSERT INTO lossitem VALUES (STR(RECCOUNT()))
>ENDFOR
>FOR K=1 TO 10000000
>NEXT
>
>T1=SECONDS()
>select COUNT(*) NR;
> from LOSSITEM X JOIN LOSSITEM Y ON RIGHT(X.Lit_LosFK,3) == RIGHT(Y.Lit_LosFK,3);
> into cursor RESULT nofilter
>? SECONDS()-T1,NR
>
>T1=SECONDS()
>select COUNT(*) NR;
> from LOSSITEM X JOIN LOSSITEM Y ON RIGHT(X.Lit_LosFK,3) = RIGHT(Y.Lit_LosFK,3);
> into cursor RESULT nofilter
>? SECONDS()-T1,NR
>
>
>If this is not written in the VFP9's documentation,
>with Font Bold 42,
>I assume many future curses.
>
>Surprise, i see VFP9b faster with == comparison ( COLLATE optimization ? );
>with another test i see a 8X speed up.
>
>But with = i leave any comment to you.
>
>Fabio
--sb--