Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fox Slow ? with CDX
Message
From
12/08/2007 08:04:44
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
12/08/2007 05:40:16
Suhas Hegde
Dental Surgeon
Sirsi, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01247603
Message ID:
01247677
Views:
31
Suhas

If you would explain what you're trying to do we can show you a better way to do it. I can't see why you need 2 SQL and a double nested scan with an internal seek. That has got to be far too complex.

Show us a small sample of the data.

symbol, open, date

then show us the expected array.

What is bhav_data.pk again?

By the way, what does the fll do? It may be possible to get the entire result in a single SQL, bypassing the fll.


>I use the array to feed to a fll.
>
>So i decided to use the CDX and use seek
>
>That Is really as fast as building a IDX and running.
>Avoided the use of SQL alto gether in the scan..endscan
>
>
>COde
>
>
>Select dist symbol from bhav_data into cursor dist1 nofilter
>select date from bhav_data group by 1 order by 1 into cursor date_temp nofilter
>select Dist1
>scan
>   dimension aopen[1]
>   arraycount = 0
>   select date_temp
>   scan
>    if seek(dtos(date)+dist1.symbol,'bhav_data','pk')
>     arraycount= arraycount+1
>     dimension aopen[arraycount]
>     aopen[arraycount] = bhav_data.open
>    endif
>   endscan
>
>* feed the array adate
>
>endscan
>
>That is fast , but not really fast as rebuilding idx in code but I feel with a marginial difference in time (about .5x difference) and well faster that using SQL abiout 3x
>
>
>
>Thanx all for putting me use the CDX
>
>Suhashegde
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform