Re: optimizing db for small table with tons of updates

From: Kenji Morishige <kenjim(at)juniper(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org, kenjim(at)juniper(dot)net
Subject: Re: optimizing db for small table with tons of updates
Date: 2006-04-03 19:02:13
Message-ID: 20060403190213.GA14328@juniper.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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 <kenjim(at)juniper(dot)net> 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alvaro Herrera 2006-04-03 19:03:54 Re: optimizing db for small table with tons of updates
Previous Message Tom Lane 2006-04-03 18:39:10 Re: optimizing db for small table with tons of updates