Re: INSERT performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: surdules(at)yahoo(dot)com (Razvan Surdulescu)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: INSERT performance
Date: 2003-11-04 21:35:55
Message-ID: 25194.1067981755@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

surdules(at)yahoo(dot)com (Razvan Surdulescu) writes:
> DCorbit(at)connx(dot)com ("Dann Corbit") wrote in message news:<D90A5A6C612A39408103E6ECDD77B829408C2E(at)voyager(dot)corporate(dot)connx(dot)com>...
>> 500 records in 12 seconds is about 42/second. Hard to know if that is
>> good or bad. Is the machine under heavy use? Are the records extremely
>> long?

>> Provide the SQL that defines the table and its indexes.

> CREATE INDEX idx_field1 ON data(field1);
> CREATE INDEX idx_field2 ON data(field2);
> ...
> CREATE INDEX idx_field20 ON data(field20);

Uh, do you actually need an index on every column?

It's obvious that the index insertions are where the time is going.
You're getting close to 900 index insertions per second, which is not
bad at all on consumer-grade ATA disk hardware, if you ask me. It might
help to raise shared_buffers, if you didn't already do that ... but the
real solution here is to only index the columns that you are actually
intending to search on.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Razvan Surdulescu 2003-11-04 22:57:16 Re: INSERT performance
Previous Message Alvaro Herrera 2003-11-04 21:34:04 Re: SELECT question