Re: inserting, index and no index - speed - Mailing list pgsql-general

From zilch@home.se
Subject Re: inserting, index and no index - speed
Date
Msg-id 20010610223430.A29479@loony
Whole thread Raw
In response to Re: inserting, index and no index - speed  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: inserting, index and no index - speed  (zilch@home.se)
List pgsql-general
> zilch@home.se writes:
> > then I have this little C++ program that inserts N rows into the tables,
> > meassures how long it takes.
>
> Which is done how, exactly?
>
>             regards, tom lane

---

// delete from index_with

// vacuum

// vacuum analyze

timeAnalyzer.startClock();

for ( int i = 0; i < nrIterations; i++) {

  sprintf(sqlStatement, "INSERT INTO index_with (name) VALUES ('%s')", data[i]);

  try {

      db->runCommand(sqlStatement);

  }
  catch(Exception e) {

       cout << "Exception caught: " << e.getException() << endl;

  }

}

timeAnalyzer.stopClock();

// output

---

data[i] is data created with 'pwgen 8 100000 > data'

Then anotherone but index_without instead.

Could it be that the 10000 rows in the table makes it so much slower so that
the next 10000 in the same database but different table get so much slower?

Daniel Akerud


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: inserting, index and no index - speed
Next
From: zilch@home.se
Date:
Subject: Re: inserting, index and no index - speed