pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shankar K <shan0075@yahoo.com>
To: Andrew Sullivan <andrew@libertyrms.info>
To: pgsql-admin@postgresql.org
Subject: Re: database running slow
Date: Tue, 13 May 2003 10:19:55 -0700 (PDT)
Message-ID: <20030513171955.37103.qmail@web21101.mail.yahoo.com> (raw)
In-Reply-To: <20030513121419.GC17278@libertyrms.info>

> 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. 
++ yes i normally vacuum/analyze only tables with huge
inserts/deletes and others once a week.

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.

++ i meant a backend process taking most of the cpu
cycles and running for ever. so i wanted to figure out
what those processes were doing and what made them to
hog the cpu cycles. 

how to look for long-running transactions ?

> 2. find out the bad sqls thats causing trouble

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

++ how to identify those queries. once i have the
queries identified then i can do explain analyze and
tune accordingly. Is there equivalent of oracle
sql_trace in postgres ?

thanks for you help

Shankar

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com




view thread (4+ messages)  latest in thread

Message-ID: <20030513171955.37103.qmail@web21101.mail.yahoo.com>
Permalink:  ../20030513171955.37103.qmail@web21101.mail.yahoo.com/
Also on:    postgresql.org/message-id/20030513171955.37103.qmail@web21101.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: shan0075@yahoo.com, andrew@libertyrms.info
  Subject: Re: database running slow
  In-Reply-To: <20030513171955.37103.qmail@web21101.mail.yahoo.com>
  References: <20030513121419.GC17278@libertyrms.info> <20030513171955.37103.qmail@web21101.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox