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] "slow" queries

2009-02-28 Thread Robert Haas
On Sat, Feb 28, 2009 at 9:51 PM, Brian Cox wrote: > Actually, they're all deadlocked. The question is why? > > Here's a brief background. The ts_defects table is partitioned by occurrence > date; each partition contains the rows for 1 day. When the data gets old > enough, the partition is dropped.

[PERFORM] "slow" queries

2009-02-28 Thread Brian Cox
Actually, they're all deadlocked. The question is why? Here's a brief background. The ts_defects table is partitioned by occurrence date; each partition contains the rows for 1 day. When the data gets old enough, the partition is dropped. Since the correct partition can be determined from the

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