Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
REPLACE Statement Efficiency
Message
De
26/06/2000 11:15:19
 
 
À
23/06/2000 18:27:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00384060
Message ID:
00384672
Vues:
35
Keith,

VFP will iterate through the replacement combinations on the REPLACE command line, and then move to the next record in the scope of the command, probably writing the updated record to a buffer.

The three separate REPLACE statements will of course make three trips through the table, as you mentioned. That's the kind of programming mistake that will bite the inexperienced, since it will not likely show up as a speed problem with the small set of sample data that the inexperienced programmer will also be using.

When the app gets some larger tables filled, the speed issue will begin to become more and more apparent, but with Fox's speed, maybe not until a few years of data has accumulated.

By then, the programmer, if still around, will have a head-slapping experience, saying, "Wow, that was a really dumb coding mistake!" :-)


>I know that if I used the second syntax with a REPLACE ALL VFP would take three trips through the database, but I'm curious as to whether internally VFP effectively converts the first form to three separate REPLACEs. The record is afterall in memory. The REPLACE statement should not actually generate any I/O until you move off the record right?
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform