Re: database running slow

From: Shankar K <shan0075(at)yahoo(dot)com>
To: Andrew Sullivan <andrew(at)libertyrms(dot)info>, pgsql-admin(at)postgresql(dot)org
Subject: Re: database running slow
Date: 2003-05-13 17:19:55
Message-ID: 20030513171955.37103.qmail@web21101.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Oliver Kullmann 2003-05-13 18:07:58 problems with moving a database
Previous Message Vinay 2003-05-13 12:15:13 [OT]:Database design question