Greg Stark <gsst...@mit.edu> writes: > On Tue, Mar 22, 2011 at 4:35 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: >> Reimplement planner's handling of MIN/MAX aggregate optimization (again).
> I'm just curious, Why is this no longer an interesting special case? > --- this is an interesting special case as of 9.1 > -explain (costs off) > - select min(unique2) from tenk1 where unique2 = 42; > - QUERY PLAN > ------------------------------------------------ > - Aggregate > - -> Index Scan using tenk1_unique2 on tenk1 > - Index Cond: (unique2 = 42) In the pathkey-based implementation, that resulted in an empty pathkey list, which that implementation couldn't deal with. I figured that was okay because the default plan isn't bad in such a case, but I put in a test case (probably because the code failed before I put in a defense against it, but I don't recall for sure). It's not particularly a corner case for the new code, though, and the resulting plan changed (because the new code will in fact turn this into a LIMIT subselect anyway). So I debated whether to change the expected output or just take it out, and I chose the latter. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers