Re: Optimizer: limit not taken into account - Mailing list pgsql-performance

From Craig A. James
Subject Re: Optimizer: limit not taken into account
Date
Msg-id 446B7241.2060409@modgraph-usa.com
Whole thread Raw
In response to Re: Optimizer: limit not taken into account  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Tom Lane wrote:
> There is not anything in there that considers whether the table's
> physical order is so nonrandom that the search will take much longer
> than it would given uniform distribution.  It might be possible to do
> something with the correlation statistic in simple cases ...

In this case, the rows are not random at all, in fact they're inserted from a sequence, then rows are deleted as they
areprocessed.  If the planner is hoping for random physical distribution, this particular case is exactly wrong.  

Craig

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Optimizer: limit not taken into account
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Speed Up Offset and Limit Clause