pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Russell Smith <mr-russ@pws.com.au>
To: Shoaib Burq (VPAC) <sab@vpac.org>
Cc: Jeff <threshar@torgo.978.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: two queries and dual cpu (perplexed)
Date: Thu, 21 Apr 2005 23:29:05 +1000
Message-ID: <200504212329.06343.mr-russ@pws.com.au> (raw)
In-Reply-To: <Pine.LNX.4.44.0504212231090.31368-100000@hp.vpac.org>
References: <Pine.LNX.4.44.0504212231090.31368-100000@hp.vpac.org>

On Thu, 21 Apr 2005 10:44 pm, Shoaib Burq (VPAC) wrote:
>   ->  Nested Loop  (cost=2.19..1069345.29 rows=16 width=58) (actual time=135.390..366902.373 rows=13276368 loops=1)
>                      ->  Nested Loop  (cost=2.19..1067304.07 rows=44 width=68) (actual time=107.627..186390.137 rows=13276368 loops=1)
>                            ->  Nested Loop  (cost=2.19..1067038.94 rows=44 width=52) (actual time=87.255..49743.796 rows=13276368 loops=1)

OUCH, OUCH, OUCH.

Most if not all of the time is going on nested loop joins.  The tuple estimates are off by a factore of 10^6 which is means it's chosing the wrong
join type.

you could set enable_seqscan to OFF;  to test what he performance is like with a different plan, and then set it back on.

However you really need to get the row count estimates up to something comparable.  within a factor of 10 at least.
A number of the other rows estimates seem to be off by a reasonable amount too.  You may want to bump up the statistics on the relevant
columns.  I can't find what they are from looking at that, I probably should be able too, but it's late.

If you get the stats up to something near the real values, then the planner will choose a different plan, which should give a huge performance
increase.

Regards

Russell Smith.




view thread (18+ messages)  latest in thread

Message-ID: <200504212329.06343.mr-russ@pws.com.au>
Permalink:  ../200504212329.06343.mr-russ@pws.com.au/
Also on:    postgresql.org/message-id/200504212329.06343.mr-russ@pws.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mr-russ@pws.com.au, sab@vpac.org, threshar@torgo.978.org
  Subject: Re: two queries and dual cpu (perplexed)
  In-Reply-To: <200504212329.06343.mr-russ@pws.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox