Re: PostgreSQL Write Performance - Mailing list pgsql-general

From Yan Cheng Cheok
Subject Re: PostgreSQL Write Performance
Date
Msg-id 732376.62487.qm@web65703.mail.ac4.yahoo.com
Whole thread Raw
In response to Re: PostgreSQL Write Performance  ("Dann Corbit" <DCorbit@connx.com>)
Responses Re: PostgreSQL Write Performance  ("Dann Corbit" <DCorbit@connx.com>)
Re: PostgreSQL Write Performance  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Re: PostgreSQL Write Performance  (Craig Ringer <craig@postnewspapers.com.au>)
Re: PostgreSQL Write Performance  (Greg Smith <greg@2ndquadrant.com>)
List pgsql-general
>> What is the actual problem you are trying to solve?

I am currently developing a database system for a high speed measurement machine.

The time taken to perform measurement per unit is in term of ~30 milliseconds. We need to record down the measurement
resultfor every single unit. Hence, the time taken by record down the measurement result shall be far more less than
milliseconds,so that it will have nearly 0 impact on the machine speed (If not, machine need to wait for database to
finishwriting, before performing measurement on next unit) 

Previously, we are using flat file.. However, using flat file is quite a mess, when come to generating reports to
customers.

Thanks and Regards
Yan Cheng CHEOK


--- On Tue, 1/5/10, Dann Corbit <DCorbit@connx.com> wrote:

> From: Dann Corbit <DCorbit@connx.com>
> Subject: Re: [GENERAL] PostgreSQL Write Performance
> To: "Yan Cheng Cheok" <yccheok@yahoo.com>
> Cc: pgsql-general@postgresql.org
> Date: Tuesday, January 5, 2010, 2:03 PM
> > -----Original Message-----
> > From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-
> > owner@postgresql.org]
> On Behalf Of Yan Cheng Cheok
> > Sent: Monday, January 04, 2010 9:05 PM
> > To: Scott Marlowe
> > Cc: pgsql-general@postgresql.org
> > Subject: Re: [GENERAL] PostgreSQL Write Performance
> >
> > Instead of sending 1000++ INSERT statements in one
> shot, which will
> > requires my application to keep track on the INSERT
> statement.
> >
> > Is it possible that I can tell PostgreSQL,
> >
> > "OK. I am sending you INSERT statement. But do not
> perform any actual
> > right operation. Only perform actual write operation
> when the pending
> > statement had reached 1000"
>
> You might use the copy command instead of insert, which is
> far faster.
> If you want the fastest possible inserts, then probably
> copy is the way
> to go instead of insert.
> Here is copy command via API:
> http://www.postgresql.org/docs/current/static/libpq-copy.html
> Here is copy command via SQL:
> http://www.postgresql.org/docs/8.4/static/sql-copy.html
>
>
> You might (instead) use this sequence:
>
> 1. Begin transaction
> 2. Prepare
> 3. Insert 1000 times
> 4. Commit
>
> If the commit fails, you will have to redo the entire set
> of 1000 or
> otherwise handle the error.
>
> Or something along those lines.  Of course, when
> information is not
> written to disk, what will happen on power failure? 
> If you do something
> cheesy like turning fsync off to speed up inserts, then you
> will have
> trouble if you lose power.
>
> What is the actual problem you are trying to solve?
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>





pgsql-general by date:

Previous
From: Tim Uckun
Date:
Subject: Re: timestams in the the pg_standby output
Next
From: "Dann Corbit"
Date:
Subject: Re: PostgreSQL Write Performance