Search Postgresql Archives

Re: Database performance problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux