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 robertmh...@gmail.com 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

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

2009-02-28 Thread Robert Haas
On Sat, Feb 28, 2009 at 9:51 PM, Brian Cox brian@ca.com 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

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 a...@bengler.no wrote: On Fri, Feb 27, 2009 at 11:54 PM, Robert Haas robertmh...@gmail.com 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