Re: [PERFORM] Bad plan for nested loop + limit

2009-03-30 Thread Alexander Staubo
On Sun, Mar 1, 2009 at 4:32 AM, Robert Haas wrote: > What do you have default_statistics_target set to?  If it's less than > 100, you should probably raise it to 100 and re-analyze (the default > value for 8.4 will be 100, but for 8.3 and prior it is 10). Changing it to 100 fixed the problem. Tha

Re: [PERFORM] Bad plan for nested loop + limit

2009-02-28 Thread Robert Haas
On Sat, Feb 28, 2009 at 11:20 AM, Alexander Staubo wrote: > On Fri, Feb 27, 2009 at 11:54 PM, Robert Haas wrote: >> The problem here is that the planner estimates the cost of a Limit >> plan node by adding up (1) the startup cost of the underlying plan >> node, in this case 0 for the nestjoin, an

Re: [PERFORM] Bad plan for nested loop + limit

2009-02-28 Thread Alexander Staubo
On Fri, Feb 27, 2009 at 11:54 PM, Robert Haas wrote: > The problem here is that the planner estimates the cost of a Limit > plan node by adding up (1) the startup cost of the underlying plan > node, in this case 0 for the nestjoin, and (2) a percentage of the run > cost, based on the ratio of the

Re: [PERFORM] Bad plan for nested loop + limit

2009-02-27 Thread Robert Haas
On Fri, Feb 27, 2009 at 3:18 PM, Alexander Staubo wrote: > On Sun, Feb 15, 2009 at 5:45 PM, Alexander Staubo wrote: >> On Sun, Feb 15, 2009 at 5:29 AM, David Wilson >> wrote: >>> On Sat, Feb 14, 2009 at 5:25 PM, Alexander Staubo wrote: Output from "explain analyze":  Limit

Re: [PERFORM] Bad plan for nested loop + limit

2009-02-27 Thread Alexander Staubo
On Sun, Feb 15, 2009 at 5:45 PM, Alexander Staubo wrote: > On Sun, Feb 15, 2009 at 5:29 AM, David Wilson > wrote: >> On Sat, Feb 14, 2009 at 5:25 PM, Alexander Staubo wrote: >>> >>> Output from "explain analyze": >>> >>>  Limit  (cost=0.00..973.63 rows=4 width=48) (actual >>> time=61.554..4039.

Re: [PERFORM] Bad plan for nested loop + limit

2009-02-15 Thread Alexander Staubo
On Sun, Feb 15, 2009 at 5:29 AM, David Wilson wrote: > On Sat, Feb 14, 2009 at 5:25 PM, Alexander Staubo wrote: >> >> Output from "explain analyze": >> >> Limit (cost=0.00..973.63 rows=4 width=48) (actual >> time=61.554..4039.704 rows=1 loops=1) >> -> Nested Loop (cost=0.00..70101.65 rows=2

Re: [PERFORM] Bad plan for nested loop + limit

2009-02-14 Thread David Wilson
On Sat, Feb 14, 2009 at 5:25 PM, Alexander Staubo wrote: > > Output from "explain analyze": > > Limit (cost=0.00..973.63 rows=4 width=48) (actual > time=61.554..4039.704 rows=1 loops=1) > -> Nested Loop (cost=0.00..70101.65 rows=288 width=48) (actual > time=61.552..4039.700 rows=1 loops=1) >