Re: Searching for the cause of a bad plan - Mailing list pgsql-performance

From Simon Riggs
Subject Re: Searching for the cause of a bad plan
Date
Msg-id 1190372365.4202.14.camel@ebony.site
Whole thread Raw
In response to Searching for the cause of a bad plan  (Csaba Nagy <nagy@ecircle-ag.com>)
Responses Re: Searching for the cause of a bad plan  (Csaba Nagy <nagy@ecircle-ag.com>)
List pgsql-performance
On Fri, 2007-09-21 at 12:03 +0200, Csaba Nagy wrote:
> prepare test_001(bigint) as
> SELECT tb.*
> FROM table_a ta
> JOIN table_b2 tb ON ta.b=tb.b
> WHERE ta.a = $1
> ORDER BY ta.a, ta.b
> limit 10;

Please re-run everything on clean tables without frigging the stats. We
need to be able to trust what is happening is normal.

Plan2 sees that b1 is wider, which will require more heap blocks to be
retrieved. It also sees b1 is less correlated than b2, so again will
require more database blocks to retrieve. Try increasing
effective_cache_size.

Can you plans with/without LIMIT and with/without cursor, for both b1
and b2?

--
  Simon Riggs
  2ndQuadrant  http://www.2ndQuadrant.com


pgsql-performance by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: Linux mis-reporting memory
Next
From: Simon Riggs
Date:
Subject: Re: Linux mis-reporting memory