Re: Database performance problem

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: Database performance problem
Дата
Msg-id 466EFD67.9060006@pinpointresearch.com
обсуждение исходный текст
Ответ на Database performance problem  ("Porell, Chris" <Chris.Porell@ceridian.com>)
Список pgsql-general
Porell, Chris wrote:
> ... I snagged a SELECT from one of the reports.  It is a
> fairly complex query with 4 joins, which unfortunately I can't share.  I can
> say that the plan for the query on both machines looks nearly identical -
> that is there are no sequential scans happening on the old DB server that
> aren't also happening on the new server.


Did you use "EXPLAIN" or "EXPLAIN ANALYZE"?

EXPLAIN alone just shows the plan - it doesn't run the query.

EXPLAIN ANALYZE runs the query and reports time actually spent at each
step. This should tell you if there is a particular part of the query
that is causing the problems.

NOTE! EXPLAIN ANALYZE executes the query, discards the result, and shows
the timing information. If the query modifies the database, those
modifications will still happen. In this case the manual recommends
wrapping the statement;
BEGIN;
EXPLAIN ANALYZE ...;
ROLLBACK;

Cheers,
Steve

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

Предыдущее
От: "Jasbinder Singh Bali"
Дата:
Сообщение: Foreign Key error
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Date style handling changes between 7.4.12 and 8.2.4