Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Load whole table into Memory
Message
De
21/08/2007 04:21:56
 
 
À
21/08/2007 04:17:05
Suhas Hegde
Dental Surgeon
Sirsi, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01249262
Message ID:
01249285
Vues:
24
I'm sorry, but I have to focus on some other problems, so I don't have the time right now to help you any more right now. Hopefully someone else can help you.

>>Is this your whole code? If so, I don't understand why you have all the scan commands? For instance
>>max_rec = 0
>>scan
>>  max_rec = max_rec+1
>>endscan
>
>Reccount returns the whole tables record count
>but i am scanning for unique index on date
>It could be done with
>select date from bhav_data group by date .. but using a index and scan wouldnt be fast ??
>
>>Can be replaces by one lines
>>max_rec=reccount()
>>And what's the purpose of these three lines of which the two last lines in fact do absolutely nothing
>>set order to
>>scan
>>endscan
>
>These are to load the whole table into memory cache ...
>
>>
>>I have the feeling that most of this code could be done in one big select statement, but I may be wrong.
>>
>>>I am basically run out of ideas
>>>
>>>
>>>here is what my final version is
>>>But still slower I feel comparitive to fox speed
>>>
>>>
>>>use bhav_data in 0 alias bhav
>>>use bhav_data in 0 alias bhav_data again
>>>
>>>select bhav_data
>>>set order to tag dau
>>>max_rec = 0
>>>scan
>>>	max_rec = max_rec+1
>>>endscan
>>>* the next 3 lines of code is run only once while the application starts not always when processing to the fll
>>>
>>>set order to
>>>scan
>>>endscan
>>>
>>>set order to tag pk1 asce
>>>
>>>select bhav
>>>set order to tag dau
>>>scan
>>>	rec2 = 0
>>>	oldexact = set('exact')
>>>	set exact off
>>>	select bhav_data
>>>	seek m.symbol
>>>   		set exact &oldexact
>>>	dimension adate[m.max_rec],thisform.open[m.max_rec],;
>>>			thisform.high[m.max_rec],thisform.low[m.max_rec],;
>>>			thisform.close[m.max_rec],thisform.volume[m.max_rec]
>>>	scan rest while symbol==m.symbol
>>>		rec2 = rec2+1
>>>		adate[rec2] = bhav_data.date
>>>		thisform.open[rec2] = mton(bhav_data.open)
>>>	    thisform.high[rec2] = mton(bhav_data.high)
>>>	    thisform.low[rec2] = mton(bhav_data.low)
>>>	    thisform.close[rec2] = mton(bhav_data.close)
>>>	    thisform.volume[rec2] = bhav_data.tottrdqty
>>>	endscan
>>>   	dimension adate[rec2],thisform.open[rec2],;
>>>   		thisform.high[rec2],thisform.low[rec2],;
>>>   		thisform.close[rec2],thisform.volume[rec2]
>>>
>>>
>>>    * process the fll
>>>
>>>endscan
>>>
>>>
>>>
>>>Any idea on how I can speed this up.
>>>I mean running the codes first time after a system restart . second time any code runs it is fast because of the cache (?)
>>>
>>>I am not sure what my remote clients system configuration would be .. may be even old pII with win98 ....
>>>
>>>suhashegde
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform