From cris@dmcid.net Sat Apr 5 14:01:31 2003 X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3C6AA474E4F; Sat, 5 Apr 2003 09:01:31 -0500 (EST) Received: from menkalinam.com (menkalinam.com [216.121.191.210]) by postgresql.org (Postfix) with ESMTP id 3923A474E42; Sat, 5 Apr 2003 09:01:30 -0500 (EST) Received: from cris (docs50-94.menta.net [62.57.49.94]) by menkalinam.com Dinamail Server with SMTPœ id h35E1Q424792; Sat, 5 Apr 2003 06:01:26 -0800 Message-ID: <003201c2fb7b$d982eaa0$5e31393e@cris> From: "Cristina Surroca" To: , Subject: Trying to Tunning DB Date: Sat, 5 Apr 2003 16:01:24 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002F_01C2FB8C.9B5B4B80" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Status: No, hits=-1.5 required=5.0 tests=BAYES_30,HTML_50_60 version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/74 X-Sequence-Number: 8229 This is a multi-part message in MIME format. ------=_NextPart_000_002F_01C2FB8C.9B5B4B80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, =20 I'm doing a project and I've have some problems. My table has (ID, atr1,..., atn), but there isn't any primary key becau= se of the specifications, it's very similar to a Data warehouse, where ever= y event is stored. It hasn't any delete, only inserts (more than 10^7) and = many updates. The thing is that it takes too much time in execute. (In my case, befor= e each update I've to do select to find which row I have to modify, and I s= uppose it does a table scan. To improve it, I've thought to use a Btree for= ID column). I use JDBC. To make it works better, I use: a.. Prepared Statements,=20 b.. setAutocommit(false), ( in my case I don't need transactions).=20 c.. I'm been reading PostgreSQL mailing list archive to try to discover o= ther kinds of "tune", or how to improve it.=20 d.. I've also read FAQ and I've found "3.6) How do I tune the data base e= ngine for better performance".=20=20 But in my case, would you think vacuum and analyze are good options? Ca= n I do everything else? Can I also disable the catalog?=20 Thanks a lot yours, Cris.. ------=_NextPart_000_002F_01C2FB8C.9B5B4B80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,

 

    I'm doing = a=20 project and I've have some problems.

    My table h= as (ID,=20 atr1,..., atn), but there isn't any primary key because of the specificatio= ns,=20 it's very similar to a Data warehouse, where every event is stored. It hasn= 't=20 any delete, only inserts (more than 10^7) and many updates.

    The thing = is that=20 it takes too much time in execute. (In my case, before each update I've to= =20 do select to find which row I have to modify, and I suppose it does a = table=20 scan. To improve it, I've thought to use a Btree for ID column).

    I use JDBC= . To=20 make it works better, I use:

  •  Prepared=20 Statements, 
  • setAutocommit(false= ),=20 ( in my case I don't need transactions).
  • I'm been reading PostgreSQL= =20 mailing list archive to try to discover other kinds of "tune", or how=20 to improve it.
  • I've also read FAQ and I've= found=20 "3.6) How do I tune the data base engine for better=20 performance". 

    But in my = case,=20 would you think vacuum and analyze are good options? Can I do everything el= se?=20 Can I  also disable the catalog?

 

Thanks a lot

 

yours,

 

 

Cris..

------=_NextPart_000_002F_01C2FB8C.9B5B4B80-- From nikolaus@dilger.cc Tue Apr 8 03:50:42 2003 X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 90B37475F09 for ; Mon, 7 Apr 2003 23:50:42 -0400 (EDT) Received: from c001.snv.cp.net (h001.c001.snv.cp.net [209.228.32.115]) by postgresql.org (Postfix) with SMTP id 97CD74758E6 for ; Mon, 7 Apr 2003 23:50:38 -0400 (EDT) Received: (cpmta 15609 invoked from network); 7 Apr 2003 20:50:42 -0700 Received: from 209.228.32.125 (HELO mail.dilger.cc.criticalpath.net) by smtp.register-admin.com (209.228.32.115) with SMTP; 7 Apr 2003 20:50:42 -0700 X-Sent: 8 Apr 2003 03:50:42 GMT Received: from [216.68.146.219] by mail.dilger.cc with HTTP; Mon, 07 Apr 2003 20:50:42 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 To: cris@dmcid.net Cc: pgsql-general@postgresql.org, pgsql-admin@postgresql.org From: "Nikolaus Dilger" Subject: Re: Trying to Tunning DB X-Sent-From: nikolaus@dilger.cc Date: Mon, 07 Apr 2003 20:50:42 -0700 (PDT) X-Mailer: Web Mail 5.2.3-0_sol28 Message-Id: <20030407205042.16302.h011.c001.wm@mail.dilger.cc.criticalpath.net> X-Spam-Status: No, hits=-13.1 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/78 X-Sequence-Number: 8233 Cris, In order to improve your performance try 1) vacuum after inserting a significant amount of data into your table. 2) Build an index on one or more of the columns used in the WHERE clause when selecting what row to update. Btree works best if the column has a high cardinality.=20 I.e. many different values. Indexes have a performance penalty during inserts but help during the select. 3) If you have enough RAM increase the number of shared buffers. Regards, Nikolaus Dilger "Cristina Surroca" wrote: Hi, =A0 =A0=A0=A0 I'm doing a=20 project and I've have some problems. =A0=A0=A0 My table has (ID,=20 atr1,..., atn), but there isn't any primary key because of the specifications,=20 it's very similar to a Data warehouse, where every event is stored. It hasn't=20 any delete, only inserts (more than 10^7) and many updates. =A0=A0=A0 The thing is that=20 it takes too much time in execute. (In my case, before each update I've to=20 do=A0select to find which row I have to modify, and I suppose it does a table=20 scan. To improve it, I've thought to use a Btree for ID column). =A0=A0=A0 I use JDBC. To=20 make it works better, I use: =20=20 =A0Prepared=20 Statements,=A0 =20=20 setAutocommit(false),=20 ( in my case I don't need transactions).=20 =20=20 I'm been reading PostgreSQL=20 mailing list archive to try to discover other kinds of "tune", or how=20 to=A0improve it.=20 =20=20 I've also read FAQ and I've found=20 "3.6) How do I tune the=A0data base engine=A0for better=20 performance".=A0=20 =A0=A0=A0 But in my case,=20 would you think vacuum and analyze are good options? Can I do everything else?=20 Can I=A0 also disable the catalog?=20 =A0 Thanks a lot =A0 yours, =A0 =A0 Cris..