Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can i speed this up ??
Message
De
06/07/2006 06:21:17
 
 
À
05/07/2006 23:58:49
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
Divers
Thread ID:
01134026
Message ID:
01134071
Vues:
16
Evaluate (ROUND((this.highlow1.ymin+this.highlow1.ymax)/2,0)*0.1)/100 only once, in stead of in every single loop. And use memory variables in stead of object values
lnLow=this.highlow1.ymin
lnHigh=this.highlow1.ymax
lnStep=(ROUND((this.highlow1.ymin+this.highlow1.ymax)/2,0)*0.1)/100
FOR m.xi = m.lnLow TO m.lnHigh STEP m.lnStep
  INSERT INTO foo (f1) values(m.xi)
NEXT
Sometimes SQL UPDATE is faster than Replace, try to change
replace f2 WITH f2+1 FOR BETWEEN(foo.f1,m.low,m.high) IN foo
into
Update foo set f2=f2+1 where f1>m.low and f1<m.high
>hi,
>here is the code which i want to speed up....
>any ideas ?? or a different approach ??? VFP 6
>
>
>lparameter ncount
>local ncount
>
>if !used('foo')
>	CREATE CURSOR foo (f1 n(20,2),f2 i)
>else
>	select foo
>	zap
>endif
>
>FOR m.xi = this.highlow1.ymin TO this.highlow1.ymax STEP (ROUND((this.highlow1.ymin+this.highlow1.ymax)/2,0)*0.1)/100
>	INSERT INTO foo (f1) values(m.xi)
>NEXT
>SELECT foo
>INDEX ON f1 TAG f1
>
>
>SELECT (this.alias_name)
>GOTO ncount
>SCAN NEXT 80
>	m.high = high
>	m.low = low
>*	replace f2 WITH f2+1 FOR foo.f1 >= m.low and foo.f1 <= m.high IN foo
> 	replace f2 WITH f2+1 FOR BETWEEN(foo.f1,m.low,m.high) IN foo
>ENDSCAN
>
>how can use the index in the above ?
>
>
>suhashegde
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform