On Thu, 7 Sep 2006, Bisma Jayadi wrote:

I tested on 1.5.1 firebird, and it inserts 610.000 records in less than 1 minute in 1 transaction.

Wow... this is very impresive indeed! I tested on 1.5.3, inserting about 300.000 records in a single transaction, took about 9 minutes!

I think it's about the table design, my table has 12 fields and some are indexed and constrained (foreign) fields. Those might causes the extra delay, I believe.

They will.


Can you give me the detail table design of your insert test above? And your firebird configuration too? So, I can compare it with my own test, and I'll try to find where the bottle neck is. TIA.


CREATE TABLE PUPIL (
  PU_ID INTEGER NOT NULL,
  PU_FIRSTNAME VARCHAR(50) NOT NULL,
  PU_LASTNAME VARCHAR(50) NOT NULL,
  CONSTRAINT PUPIL_PK PRIMARY KEY (PU_ID)
);

CREATE TABLE PUPILTRACK (
  PT_ID INTEGER NOT NULL,
  PT_PUPIL_FK INTEGER  NOT NULL,
  PT_CODE CHAR(1)  NOT NULL,
  PT_DATE DATE NOT NULL,
  PT_TIME TIME NOT NULL,
  CONSTRAINT PUPILTRACK_PK PRIMARY KEY (PT_ID)
);

CREATE INDEX I_PUPILTRACK_PUPIL ON PUPILTRACK (PT_PUPIL_FK)
CREATE INDEX I_PUPILTRACK_DATE ON PUPILTRACK (PT_DATE);
CREATE INDEX I_PUPILLASTNAME ON PUPIL (PU_LASTNAME);
CREATE INDEX I_PUPILFIRSTNAME ON PUPIL (PU_FIRSTNAME);
ALTER TABLE PUPILTRACK ADD CONSTRAINT R_TRACK_PUPIL FOREIGN KEY (PT_PUPIL_FK) 
REFERENCES PUPIL(PU_ID);

1000 records in table 1, 600.000 in table 2 (600 track records per pupil 
record...)

SQL statements to do this were read from a big file, 1 statement per line.

Firebird configuration: embedded firebird.
I tried using C/S as well, and the difference was neglectable.
Tested on Linux, AMD64 3000, SuSE 9.3 i386.

Michael.

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to