Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append blank VS insert SQL
Message
De
22/03/2005 20:16:13
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
22/03/2005 06:13:18
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00998018
Message ID:
00998307
Vues:
23
>>and what about speed ?
>>I made a test and seems like append was 4 to 10 times slower
>
>I wouldn't comment on that. From test to test one might be faster than the other. My reasoning is simple:
>
>select myTable
>Append Blank
>replace field1 with m.somevalue, ...
>
>vs:
>
>insert into myTable (field1, ...) values (m.somevalue, ...)
>
>latter is a single atomic operation. Insert into also have variations like "insert into ... from memvar|array".
>
>It has been a long time I don't use 'Append Blank'.

I'd only add one more thing: since the table is very likely to have indexes, the indexes need to be updated too. With append blank, we're writing blanks into the fields and indexes, then during a replace we're doing it again (and potentially reshuffling some of the b-trees in some of the indexes). So it's not one write vs two writes, it's n writes vs 2*n writes.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform