Re: database running slow

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: database running slow
Date: 2003-05-13 12:14:19
Message-ID: 20030513121419.GC17278@libertyrms.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, May 12, 2003 at 11:55:11AM -0700, Shankar K wrote:

> Since our application involves high inserts/deletes,
> we vacuum/analyze major tables thrice a day. Apart
> from this

Be sure you really need the vacuum before you do it. Remember,
vacuum destroys your buffers, so it's not free. On certain kinds of
tables, it can be worth it to do a vacuum very often (we have some we
do once an hour).

> 1. how to identify run-away sql backends

Define "run-away". You can look for long-running transactions; that
might be helpful.

> 2. find out the bad sqls thats causing trouble

Look for queries that take a long time. EXPLAIN ANALYSE is your
friend.

A
--
----
Andrew Sullivan 204-4141 Yonge Street
Liberty RMS Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info> M2P 2A8
+1 416 646 3304 x110

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Vinay 2003-05-13 12:15:13 [OT]:Database design question
Previous Message Andrew Sullivan 2003-05-13 12:10:31 Re: No flamefest please, MySQL vs. PostgreSQL AGAIN