X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id AF8D211F6625 for ; Mon, 3 Apr 2006 16:02:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62728-04 for ; Mon, 3 Apr 2006 16:02:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from colo-dns-ext1.juniper.net (colo-dns-ext1.juniper.net [207.17.137.57]) by postgresql.org (Postfix) with ESMTP id A88DE11F65EC for ; Mon, 3 Apr 2006 16:02:19 -0300 (ADT) Received: from merlot.juniper.net (merlot.juniper.net [172.17.27.10]) by colo-dns-ext1.juniper.net (8.11.3/8.9.3) with ESMTP id k33J2IX92457; Mon, 3 Apr 2006 12:02:18 -0700 (PDT) (envelope-from kenjim@juniper.net) Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [172.17.58.60]) by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id k33J2D510489; Mon, 3 Apr 2006 12:02:13 -0700 (PDT) (envelope-from kenjim@juniper.net) Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [127.0.0.1]) by kenjim-lnx.juniper.net (8.13.4/8.13.4) with ESMTP id k33J2D5Z014436; Mon, 3 Apr 2006 12:02:13 -0700 Received: (from kenjim@localhost) by kenjim-lnx.juniper.net (8.13.4/8.13.4/Submit) id k33J2D7C014435; Mon, 3 Apr 2006 12:02:13 -0700 Date: Mon, 3 Apr 2006 12:02:13 -0700 From: Kenji Morishige To: Tom Lane Cc: pgsql-performance@postgresql.org, kenjim@juniper.net Subject: Re: optimizing db for small table with tons of updates Message-ID: <20060403190213.GA14328@juniper.net> References: <20060403182403.GA12257@juniper.net> <15521.1144089550@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15521.1144089550@sss.pgh.pa.us> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200604/28 X-Sequence-Number: 18112 I've been stumped as to how to call psql from the command line without it prompting me for a password. Is there a enviornoment variable I can specify for the password or something I can place in .pgsql? I could write a perl wrapper around it, but I've been wondering how I can call psql -c without it prompting me. Is it possible? -Kenji On Mon, Apr 03, 2006 at 02:39:10PM -0400, Tom Lane wrote: > Kenji Morishige writes: > > Various users run a tool that updates this table to determine if the particular > > resource is available or not. Within a course of a few days, this table can > > be updated up to 200,000 times. There are only about 3500 records in this > > table, but the update and select queries against this table start to slow > > down considerablly after a few days. Ideally, this table doesn't even need > > to be stored and written to the filesystem. After I run a vacuum against this > > table, the overall database performance seems to rise again. > > You should never have let such a table go that long without vacuuming. > > You might consider using autovac to take care of it for you. If you > don't want to use autovac, set up a cron job that will vacuum the table > at least once per every few thousand updates. > > regards, tom lane