Re: Fwd: My Query to insert and retrieve takes time - Mailing list pgsql-admin

From Tom Lane
Subject Re: Fwd: My Query to insert and retrieve takes time
Date
Msg-id 6405.1320415686@sss.pgh.pa.us
Whole thread Raw
In response to Fwd: My Query to insert and retrieve takes time  (Shivakumar Ramannavar <shivasr@gmail.com>)
List pgsql-admin
Shivakumar Ramannavar <shivasr@gmail.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

pgsql-admin by date:

Previous
From: Shivakumar Ramannavar
Date:
Subject: Fwd: My Query to insert and retrieve takes time
Next
From: Jelena
Date:
Subject: PostgreSQL statement latency