Re: [BUGS] BUG #4926: too few pathkeys for mergeclauses

2009-07-17 Thread Tom Lane
"Roman Kononov" writes: > Description:too few pathkeys for mergeclauses I've applied a patch for this. Thanks for the report. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.post

Re: [BUGS] BUG #4926: too few pathkeys for mergeclauses

2009-07-17 Thread Tom Lane
I wrote: > I think what this case may show is simply that the consistency > checking I added to create_mergejoin_plan in 8.3 is too strict. > Not quite convinced yet though. After further review I think that is the correct approach to take. The proximate cause of the problem is that find_mergecla

Re: [BUGS] BUG #4926: too few pathkeys for mergeclauses

2009-07-17 Thread Tom Lane
Heikki Linnakangas writes: > Version 8.3 has the same bug, apparently introduced along with the > equivalence classes. In 8.2, the merge condition is reduced into (i=x > AND i=y), IOW the planner eliminates the duplicate condition. I believe > 8.2 would otherwise have the same problem as well. Th

Re: [BUGS] BUG #4926: too few pathkeys for mergeclauses

2009-07-17 Thread Heikki Linnakangas
Heikki Linnakangas wrote: > 2. make_inner_pathkeys_for_merge() should have created sort order (x, y, > x) for the inner side. On further thought, that would make no sense. Sort order (x, y) is always equivalent to (x, y, x). -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com -

Re: [BUGS] BUG #4926: too few pathkeys for mergeclauses

2009-07-17 Thread Heikki Linnakangas
Greg Stark wrote: > On Thu, Jul 16, 2009 at 9:07 PM, Roman Kononov wrote: >> test=# create table junk(i int); >> CREATE TABLE >> test=# select * from junk left outer join (select coalesce(i,1) as x, >> coalesce(i,2) as y from junk) t on coalesce(i,3)=x and coalesce(i,4)=y and >> coalesce(i,5)=x; >>

Re: [BUGS] BUG #4926: too few pathkeys for mergeclauses

2009-07-16 Thread Greg Stark
On Thu, Jul 16, 2009 at 9:07 PM, Roman Kononov wrote: > > test=# create table junk(i int); > CREATE TABLE > test=# select * from junk left outer join (select coalesce(i,1) as x, > coalesce(i,2) as y from junk) t on coalesce(i,3)=x and coalesce(i,4)=y and > coalesce(i,5)=x; > ERROR:  too few pathkey