INSERT is faster?

 

Quick test, using 7.5: 

 

EXAM is a 100 row table w 31 cols, no indexes or keys. Table TEST has
identical definition, no rows.

APPEND EXAM 1000 times (creating 100,000 rows in TEST) takes about 9.25 sec.

INSERT 1000 times takes 5.1 sec. (Oddly, every fourth try the time goes down
to 3.8s)

 

Program:

 

SET TIME FORMAT HH:MM:SS.SSS

SET MESSAGES OFF

DELETE FROM TEST

SET V vX INTEGER=0

SHOW V #TIME

WHILE vX<1000 THEN

   APPEND EXAM TO TEST / INSERT INTO TEST SELECT * FROM EXAM

   SET V vX=.vX+1

ENDWHILE

SHOW V #TIME

 

Regards,

 

Stephen Markson
ForenSys The Forensic Systems Group
www.ForenSys.ca <http://www.forensys.ca/> 
416 512 6950

 

  _____  

From: [email protected] [mailto:[email protected]] On Behalf Of TOM HART
Sent: April 13, 2009 11:54 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - SV: Append vs insert

 

Thats what I have been noticing over time and have mostly went to insert,
but it does require fewer lines of code for append.

Tom

 

  _____  

From: Gunnar Ekblad <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Monday, April 13, 2009 10:45:48 AM
Subject: [RBASE-L] - SV: Append vs insert

Tom

I am happy to use append

It works fine within R:Base (the only db you really want to use)

But if you are required to work with foreihg DB, then you better stick to
INSERT, since that is working both with R:Base and foreign DB.

I understand INSERT to be SQL standard and append to be R:BASE specific!

If I create a new program I use insert but I am happy to keep my R:Base
append code!

 

 

Gunnar Ekblad

Kontema IT AB

Hästholmsvägen 32

131 30 Nacka

Sweden

 

-----Ursprungligt meddelande-----
Från: [email protected] [mailto:[email protected]] För TOM HART
Skickat: den 13 april 2009 15:50
Till: RBASE-L Mailing List
Ämne: [RBASE-L] - Append vs insert

I have followed the discussion in the past about append vs insert.  I had
always used append, but within the last year have converted all of my
appends to insert and just want to know the pros and cons of which one to
use.  Most of my inserts use exact table structures ie same number of
columns and names.

Thanks, 

Tom Hart

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.287 / Virus Database: 270.11.54/2056 - Release Date: 04/13/09
05:51:00


Reply via email to