Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 73B782E00B7 for ; Wed, 6 Feb 2008 13:44:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 52378-07 for ; Wed, 6 Feb 2008 13:44:37 -0400 (AST) Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.187]) by postgresql.org (Postfix) with ESMTP id 32ABE2E3573 for ; Wed, 6 Feb 2008 13:44:37 -0400 (AST) Received: by ti-out-0910.google.com with SMTP id y6so785222tia.5 for ; Wed, 06 Feb 2008 09:44:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=9iQkrJgk6qnSbFi7JJwlM4CYDk8AcpitzFzDO3rP9SM=; b=ERVx7SzRKBcr8gaX94ZcLA0bN6qZRnOq8HUkEc3MC2yBihV8yQgUb9bsmCR7bCqv8/gyh4LSmGdAfKEmIi03KcoYKbdgSAXydFUXwJR8jq9YIPzBwfJFtqRI/6+TUF2V8xAOvv//DlnxJof2wmSMzoKMFqkKj/TmiyAIbL7LixU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=co9TN1iReJQfwYObEV/OogcyzwKSfW07v4Tn4qab7qUfLa6Qg/5ejFC06UNaEp1TBJSAzWLfI6kZUDyEMNEqu6Pdj52Lr2NEUEtRv9FtTdlZjd7GlgXxwK4s7VFavTqZlTkqDI7x2ngS9qE121FfvUx83DOWhQ6/9euLzkJI+h0= Received: by 10.150.215.16 with SMTP id n16mr4321549ybg.104.1202319874109; Wed, 06 Feb 2008 09:44:34 -0800 (PST) Received: by 10.150.197.17 with HTTP; Wed, 6 Feb 2008 09:44:34 -0800 (PST) Message-ID: <1d219a6f0802060944s55c3a5cbw61cf99010c2f863a@mail.gmail.com> Date: Wed, 6 Feb 2008 12:44:34 -0500 From: "Chris Hoover" To: "pgsql-admin@postgresql.org Admin" Subject: Help calculating load values MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9167_10184127.1202319874113" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/67 X-Sequence-Number: 28141 ------=_Part_9167_10184127.1202319874113 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I need some help calculating how much activity a query causes. If I have a table defined as: create table test_a ( col1 integer, col2 char(1), col3 varchar(35), primary key (col1,col2) ) with oids; When I do an "insert into test_a values (1,'a','test data');", does this generate 3 writes (1 to table, 1 to index, and one to oid counter) and one read (get oid from oid counter)? What about when I do an "update test_a set col3='changed data' where col1 = 1 and col2 = 'a';"? I am thinking 5 writes (1 to old table tuple, 1 to old index tuple, 1 to oid counter, 1 to new table tuple, one to new index tuple) with 1 read (get oid from oid counter)? Finally, what about the delete "delete from test_a where col1=1 and col2='a';"? 2 writes (1 to table tuple, and 1 to index tuple)? I am just trying to get a grasp on how much traffic I am creating for each major dml statement we issue so that I can work with my sysadmin on some i/o issues. Thanks, Chris PG 8.1 RH 4 -- Come see how to SAVE money on fuel, decrease harmful emissions, and even make MONEY. Visit http://colafuelguy.mybpi.com and join the revolution! ------=_Part_9167_10184127.1202319874113 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I need some help calculating how much activity a query causes.

If I have a table defined as:
create table test_a (
  col1 integer,
  col2 char(1),
  col3 varchar(35),
  primary key (col1,col2)
) with oids;

When I do an "insert into test_a values (1,'a','test data');", does this generate 3 writes (1 to table, 1 to index, and one to oid counter)  and one read (get oid from oid counter)? 

What about when I do an "update test_a set col3='changed data' where col1 = 1 and col2 = 'a';"?  I am thinking 5 writes (1 to old table tuple, 1 to old index tuple, 1 to oid counter, 1 to new table tuple, one to new index tuple) with 1 read (get oid from oid counter)?

Finally, what about the delete "delete from test_a where col1=1 and col2='a';"?  2 writes (1 to table tuple, and 1 to index tuple)?

I am just trying to get a grasp on how much traffic I am creating for each major dml statement we issue so that I can work with my sysadmin on some i/o issues.

Thanks,

Chris

PG 8.1
RH 4

--
Come see how to SAVE money on fuel, decrease harmful emissions, and even make MONEY.  Visit http://colafuelguy.mybpi.com and join the revolution! ------=_Part_9167_10184127.1202319874113--