Re: Low CPU Usage

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-performance(at)postgresql(dot)org>,<brauagustin-susc(at)yahoo(dot)com(dot)ar>
Subject: Re: Low CPU Usage
Date: 2007-09-21 17:51:57
Message-ID: 46F3BE6C.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>>> On Fri, Sep 21, 2007 at 12:30 PM, in message
<121711(dot)47531(dot)qm(at)web30006(dot)mail(dot)mud(dot)yahoo(dot)com>, <brauagustin-susc(at)yahoo(dot)com(dot)ar>
wrote:

> This is the plan for the old server:
> Hash Join (cost=449.55..8879.24 rows=136316 width=904) (actual
> time=50.734..1632.491 rows=136316 loops=1)
. . .
> Total runtime: 2022.293 ms

> And this is the plan for the new server:
> Hash Join (cost=412.86..9524.13 rows=136316 width=905) (actual
> time=9.421..506.376 rows=136316 loops=1)
. . .
> Total runtime: 553.619 ms

> I see an "outer" join in the plan for the new server. This is weird!!! There
> are the same databases in both servers.

That's just a matter of labeling the tables with role rather than alias.
The plans look the same to me.

> The old one runs this query for about 37 seconds and for the new one for
> about 301 seconds.

That's not what it looks like based on the EXPLAIN ANALYZE output.
It looks like run time dropped from two seconds to half a second.

It seems as though you either have a network delay delivering the results,
or your application is slow to read them.

Exactly how are you arriving at those timings you're reporting to us?

-Kevin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2007-09-21 17:53:40 Re: Searching for the cause of a bad plan
Previous Message Simon Riggs 2007-09-21 17:49:33 Re: Query planner unaware of possibly best plan