Re: [HACKERS] Fix for gistchoose

2012-08-30 Thread Robert Haas
On Thu, Aug 30, 2012 at 4:48 PM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Aug 30, 2012 at 4:15 PM, Tom Lane wrote: >>> Yeah, the idea of replacing sum_grow with a boolean just occurred to me >>> too. As is, I think the code is making some less-than-portable >>> assumptions about what wi

Re: [HACKERS] Fix for gistchoose

2012-08-30 Thread Tom Lane
Robert Haas writes: > On Thu, Aug 30, 2012 at 4:15 PM, Tom Lane wrote: >> Yeah, the idea of replacing sum_grow with a boolean just occurred to me >> too. As is, I think the code is making some less-than-portable >> assumptions about what will happen if sum_grow overflows; which can >> definitely

Re: [HACKERS] Fix for gistchoose

2012-08-30 Thread Robert Haas
On Thu, Aug 30, 2012 at 4:15 PM, Tom Lane wrote: > Robert Haas writes: >> I noticed all that, but didn't feel like putting in the effort to make >> it better. I would have been happy to have someone else pick up the >> patch, but as it had been languishing I thought it would be better to >> get

Re: [HACKERS] Fix for gistchoose

2012-08-30 Thread Tom Lane
Robert Haas writes: > I noticed all that, but didn't feel like putting in the effort to make > it better. I would have been happy to have someone else pick up the > patch, but as it had been languishing I thought it would be better to > get it committed more or less as it was than to wait for som

Re: [HACKERS] Fix for gistchoose

2012-08-30 Thread Robert Haas
On Thu, Aug 30, 2012 at 3:27 PM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Aug 30, 2012 at 1:27 PM, Tom Lane wrote: >>> Should we backpatch that? > >> Arguably, yes. Does the patch look sane to you? > > I was afraid you'd ask that. > > [ studies code for awhile ... ] > > I think this fix

Re: [HACKERS] Fix for gistchoose

2012-08-30 Thread Tom Lane
Robert Haas writes: > On Thu, Aug 30, 2012 at 1:27 PM, Tom Lane wrote: >> Should we backpatch that? > Arguably, yes. Does the patch look sane to you? I was afraid you'd ask that. [ studies code for awhile ... ] I think this fixes the bug, but the function could really do with slightly more i

Re: [HACKERS] Fix for gistchoose

2012-08-30 Thread Alexander Korotkov
On Thu, Aug 30, 2012 at 9:11 PM, Robert Haas wrote: > On Mon, Aug 20, 2012 at 12:57 PM, Alexander Korotkov > wrote: > > I found that code of gistchoose doesn't follow it's logic. Idea of > > gistchoose is that first column penalty is more important than penalty of > > second column. If we meet s

Re: [HACKERS] Fix for gistchoose

2012-08-30 Thread Robert Haas
On Thu, Aug 30, 2012 at 1:27 PM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Aug 20, 2012 at 12:57 PM, Alexander Korotkov >> wrote: >>> I found that code of gistchoose doesn't follow it's logic. Idea of >>> gistchoose is that first column penalty is more important than penalty of >>> second

Re: [HACKERS] Fix for gistchoose

2012-08-30 Thread Tom Lane
Robert Haas writes: > On Mon, Aug 20, 2012 at 12:57 PM, Alexander Korotkov > wrote: >> I found that code of gistchoose doesn't follow it's logic. Idea of >> gistchoose is that first column penalty is more important than penalty of >> second column. If we meet same penalty values of first column t

Re: [HACKERS] Fix for gistchoose

2012-08-30 Thread Robert Haas
On Mon, Aug 20, 2012 at 12:57 PM, Alexander Korotkov wrote: > I found that code of gistchoose doesn't follow it's logic. Idea of > gistchoose is that first column penalty is more important than penalty of > second column. If we meet same penalty values of first column then we choose > minimal pena