Re: How to know which queries are to be optimised?

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: How to know which queries are to be optimised?
Дата
Msg-id 20040811162701.GA9992@wolff.to
обсуждение исходный текст
Ответ на How to know which queries are to be optimised?  (Ulrich Wisser <ulrich.wisser@relevanttraffic.se>)
Ответы My admin left the job and I am stuck  (Karam Chand <karam_chand03@yahoo.com>)
Список pgsql-general
On Wed, Aug 04, 2004 at 14:00:39 +0200,
  Ulrich Wisser <ulrich.wisser@relevanttraffic.se> wrote:

This topic really belongs on the performance list. I have copied that
list and set followups to go there and copy you.

>
> my web application grows slower and slower over time. After some
> profiling I came to the conclusion that my SQL queries are the biggest
> time spenders (25 seconds). Obviously I need to optimise my queries and
> maybe introduce some new indexes.

This sounds like you aren't doing proper maintainance. You need to be
vacuuming with a large enough FSM setting.

> The problem is, that my application uses dynamic queries. I therefor can
> not determine what are the most common queries.
>
> I have used the postgresql logging ption before. Is there a tool to
> analyze the logfile for the most common and/or most time consuming queries?

You can log queries that run for at least a specified amount of time.
This will be useful in finding what the long running queries are.
You can then use explain analyse to see why they are long running.

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Replication options?
Следующее
От: Csaba Nagy
Дата:
Сообщение: Re: the behaviour of timestamp on postgres.