Re: PostgreSQL Write Performance - Mailing list pgsql-general
From | Yan Cheng Cheok |
---|---|
Subject | Re: PostgreSQL Write Performance |
Date | |
Msg-id | 63583.95240.qm@web65714.mail.ac4.yahoo.com Whole thread Raw |
In response to | Re: PostgreSQL Write Performance (Scott Marlowe <scott.marlowe@gmail.com>) |
Responses |
Re: PostgreSQL Write Performance
Re: PostgreSQL Write Performance |
List | pgsql-general |
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 operationwhen the pending statement had reached 1000" Thanks and Regards Yan Cheng CHEOK --- On Tue, 1/5/10, Scott Marlowe <scott.marlowe@gmail.com> wrote: > From: Scott Marlowe <scott.marlowe@gmail.com> > Subject: Re: [GENERAL] PostgreSQL Write Performance > To: "Yan Cheng Cheok" <yccheok@yahoo.com> > Cc: pgsql-general@postgresql.org > Date: Tuesday, January 5, 2010, 11:45 AM > On Mon, Jan 4, 2010 at 8:36 PM, Yan > Cheng Cheok <yccheok@yahoo.com> > wrote: > > I am not sure whether I am doing the correct > benchmarking way. > > > > I have the following table ; > > > > CREATE TABLE measurement_type > > ( > > measurement_type_id bigserial NOT NULL, > > measurement_type_name text NOT NULL, > > CONSTRAINT pk_measurement_type_id PRIMARY KEY > (measurement_type_id), > > CONSTRAINT > measurement_type_measurement_type_name_key UNIQUE > (measurement_type_name) > > ) > > > > I make the following single write operation through > pgAdmin : > > > > INSERT INTO measurement_type ( measurement_type_name > ) > > VALUES('Width'); > > > > It takes 16ms to write a single row according to > "Query Editor" (bottom right corner) > > > > Am I doing the correct way to benchmarking? I am not > sure whether this is expected performance? For me, I am > expecting the time measurement is in nano seconds :p > > It would be great if a hard drive could seek write, > acknowledge the > write and the OS could tell the db about it in nano > seconds. However, > some part of that chain would have to be lieing to do > that. It takes > at LEAST a full rotation of a hard drive to commit a single > change to > a database, usually more. Given that the fastest HDs > are 15k RPM > right now, you're looking at 250 revolutions per second, or > 1/250th of > a second minimum to commit a transaction. > > Now, the good news is that if you make a bunch of inserts > in the same > transaction a lot of them can get committed together to the > disk at > the same time, and the aggregate speed will be, per insert, > much > faster. > > -- > 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: