Re: [HACKERS] patch for geqo tweaks

2015-11-06 Thread Gavin Flower
On 07/11/15 09:59, Nathan Wagner wrote: [...] My day to make a fool of myself in public I guess. You're right of course. I can only plead distraction by having too many projects in mind at once and not focusing properly. Sorry for taking up your time on things I should have checked better. [..

Re: [HACKERS] patch for geqo tweaks

2015-11-06 Thread Nathan Wagner
On Fri, Nov 06, 2015 at 02:16:41PM -0500, Tom Lane wrote: > Uh, what? It's not by any means turned off by default. > > postgres=# select name,setting from pg_settings where name like '%geqo%'; > name | setting > -+- > geqo| on [snip]

Re: [HACKERS] patch for geqo tweaks

2015-11-06 Thread Tom Lane
Nathan Wagner writes: > On Fri, Nov 06, 2015 at 11:45:38AM -0500, Tom Lane wrote: >> (There's a fair amount of dead code in /geqo/, which I've never had >> the energy to clean up, but maybe we should do that sometime. It >> seems unlikely that anyone will ever be interested in experimenting >> wi

Re: [HACKERS] patch for geqo tweaks

2015-11-06 Thread Nathan Wagner
On Fri, Nov 06, 2015 at 11:45:38AM -0500, Tom Lane wrote: > However, really the whole argument is moot, because I notice that > geqo_mutation() is only called in the "#ifdef CX" code path, which > we don't use. I suppose someone could turn it on via a compiler define. > So there's little point i

Re: [HACKERS] patch for geqo tweaks

2015-11-06 Thread Nathan Wagner
On Fri, Nov 06, 2015 at 11:19:00AM -0500, Tom Lane wrote: > Nathan Wagner writes: > > I see you committed a modified version of my patch in commit > > 59464bd6f928ad0da30502cbe9b54baec9ca2c69. > > > You changed the tour[0] to be hardcoded to 1, but it should be any > > of the possible gene number

Re: [HACKERS] patch for geqo tweaks

2015-11-06 Thread Tom Lane
Nathan Wagner writes: > On Wed, Nov 04, 2015 at 12:51:52PM -0500, Tom Lane wrote: >> I'm not very impressed with the first patch: it might save a few >> geqo_randint() calls, but it seems to do so at the price of making the >> swap choices less random --- for instance it sure looks to me like the

Re: [HACKERS] patch for geqo tweaks

2015-11-06 Thread Tom Lane
Nathan Wagner writes: > I see you committed a modified version of my patch in commit > 59464bd6f928ad0da30502cbe9b54baec9ca2c69. > You changed the tour[0] to be hardcoded to 1, but it should be any of > the possible gene numbers from 0 to remainder. How so? The intent is to replace the first it

Re: [HACKERS] patch for geqo tweaks

2015-11-05 Thread Nathan Wagner
On Wed, Nov 04, 2015 at 12:51:52PM -0500, Tom Lane wrote: > As for the second part, I had to look up Fisher-Yates ;-) but after > having read Wikipedia's entry about it I think this is a good change. > The code's shorter and more efficient, and it should mathematically > provide an equally-unbiase

Re: [HACKERS] patch for geqo tweaks

2015-11-05 Thread Nathan Wagner
On Wed, Nov 04, 2015 at 12:51:52PM -0500, Tom Lane wrote: > Nathan Wagner writes: > > I have two patches to make the geqo initialization and mutation > > slightly better. > > > The first adjusts the mutation swaps to avoid having to re-pick > > ties. The second changes the initialization and shu

Re: [HACKERS] patch for geqo tweaks

2015-11-04 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Having said that, though, I believe that it's also probably a >> *different* initial shuffle, which may well mean that GEQO gives >> different plans in some cases. That doesn't bother me as long as >> we only make the change in HEAD, but does anyone wan

Re: [HACKERS] patch for geqo tweaks

2015-11-04 Thread Alvaro Herrera
Tom Lane wrote: > Having said that, though, I believe that it's also probably a > *different* initial shuffle, which may well mean that GEQO gives > different plans in some cases. That doesn't bother me as long as > we only make the change in HEAD, but does anyone want to complain? Uh, do we pro

Re: [HACKERS] patch for geqo tweaks

2015-11-04 Thread Tom Lane
Nathan Wagner writes: > I have two patches to make the geqo initialization and mutation > slightly better. > The first adjusts the mutation swaps to avoid having to re-pick > ties. The second changes the initialization and shuffling algorithm > for the gene array to use an in-place Fisher-Yates

Re: [HACKERS] patch for geqo tweaks

2015-09-08 Thread Thom Brown
On 8 September 2015 at 14:44, Nathan Wagner wrote: > I have two patches to make the geqo initialization and mutation > slightly better. > > The first adjusts the mutation swaps to avoid having to re-pick > ties. The second changes the initialization and shuffling algorithm > for the gene array t

[HACKERS] patch for geqo tweaks

2015-09-08 Thread Nathan Wagner
I have two patches to make the geqo initialization and mutation slightly better. The first adjusts the mutation swaps to avoid having to re-pick ties. The second changes the initialization and shuffling algorithm for the gene array to use an in-place Fisher-Yates shuffling algorithm. Diffs again