>Hi all
>I have a table XXX with 25 fields (ctype, nNum, ... filed25) and aprox 100.000 records and following code:
>
>scan for ctype=cvar1 and nnum=nvar2
>...
>endscan
>
>
>Recently this scan became very slow. I've indexed the table in cType and nNum to optimyze speed but it does no work...
>Any ideas would be great.
>
>Thank's in advance,
>NPedro
Try instead of scan for
if seek(m.cVar1,'myTable','cType')
set order to tag cType
scan while cType = m.cVar1 for nNum = m.nVar
...
endscan
endif
If it's not broken, fix it until it is.
My Blog