Re: join regression failure on cygwin - Mailing list pgsql-hackers

From Tom Lane
Subject Re: join regression failure on cygwin
Date
Msg-id 26720.1248445343@sss.pgh.pa.us
Whole thread Raw
In response to Re: join regression failure on cygwin  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: join regression failure on cygwin  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
I wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> It appears on Googling a bit that the erand48() is buggy in that it 
>> requires the seed to have been initialized with srand48() or it will 
>> constantly return 0.0.

> Huh, and that sends us into an infinite loop?  I'll take a look at that.
> Even though it's surely nonrandom, it doesn't seem like pathological
> behavior of the RNG should wedge us completely.

The answer is that a constant RNG result sends this bit of
geqo_selection() into a tight loop:
   int         first,               second;
   first = linear(root, pool->size, bias);   second = linear(root, pool->size, bias);
   if (pool->size > 1)   {       while (first == second)           second = linear(root, pool->size, bias);   }

Not sure if it's worth trying to do something about that, or exactly
what we'd do anyway.  Even if we hacked this up somehow, a constant RNG
result would pretty much break GEQO for any useful purpose.  So it could
be argued that having the regression tests fail here is a good thing...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: query decorrelation in postgres
Next
From: Andrew Dunstan
Date:
Subject: Re: join regression failure on cygwin