Re: Fwd: My Query to insert and retrieve takes time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shivakumar Ramannavar <shivasr(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Fwd: My Query to insert and retrieve takes time
Date: 2011-11-04 14:08:06
Message-ID: 6405.1320415686@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Shivakumar Ramannavar <shivasr(at)gmail(dot)com> writes:
> Here is some observation drawn from PostgreSQL performance testing:

> There are around 310,000 records, it takes 8.313 milliseconds to
> retrieval/search a record, and it takes 8.321 milliseconds more to update a
> record.

It was already pointed out to you that these numbers are suspiciously
close together, and also suspiciously close to the rotation time of a
7200RPM disk. It seems very likely that you have configured things so
that each operation is done in a transaction that has to be explicitly
committed to disk, thus requiring a write to WAL, which would limit the
transaction rate to one per rotation. However, since you haven't shown
us anything about how the queries are being issued, we can't confirm
or disprove that theory.

Consider batching multiple operations into a single transaction.
Turning off synchronous_commit is another possibility, depending on
what your crash-safety requirements are.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jelena 2011-11-05 15:43:51 PostgreSQL statement latency
Previous Message Shivakumar Ramannavar 2011-11-04 09:27:04 Fwd: My Query to insert and retrieve takes time