Re: Disk access with fsync on.

Lists: pgsql-novice
From: "Bhide, Rajan" <rbhide(at)starentnetworks(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Disk access with fsync on.
Date: 2005-12-12 09:17:45
Message-ID: 069D834B7DEFB742A1781854356005E005581A@EXCHINDIA2.starentnetworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Hi,

I would like to know the disk access mechanism for writing data with
default fsync "on".
I am using libpq client library to insert data to db server.
The insert query is typically done as a transaction with fsync "on"
i.e.:

begin;
insert into <tablename> values<values>;
end;

My query is how does it translate to disk access.
Does each insert writes to disk or to memory segment and a consolidated
write to disk, based on segment full or timeout.

I am using Postgres 7.4.5 on Sun Solaris 8.

Thanks,
-Rajan

"This email message and any attachments are confidential information of Starent Networks, Corp. The information transmitted may not be used to create or change any contractual obligations of Starent Networks, Corp. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this e-mail and its attachments by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify the sender immediately -- by replying to this message or by sending an email to postmaster(at)starentnetworks(dot)com -- and destroy all copies of this message and any attachments without reading or disclosing their contents. Thank you."


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bhide, Rajan" <rbhide(at)starentnetworks(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Disk access with fsync on.
Date: 2005-12-12 15:13:41
Message-ID: 1846.1134400421@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

"Bhide, Rajan" <rbhide(at)starentnetworks(dot)com> writes:
> I would like to know the disk access mechanism for writing data with
> default fsync "on".

The only forced disk write (ie, the only thing you normally have to wait
for) is writing the WAL log entry/entries at "commit".

regards, tom lane