On 02/11/2011, at 2:16 PM, Tom Lane wrote:
> Royce Ausburn writes:
>> [ random() is evaluated only once in ]
>> test=# select (select random()) from generate_series(1,10); -- rows are the
>> same
>
>> I understand that it's likely an optimisation thing -- postgres knows
>> that the subselect d
Royce Ausburn writes:
> [ random() is evaluated only once in ]
> test=# select (select random()) from generate_series(1,10); -- rows are the
> same
> I understand that it's likely an optimisation thing -- postgres knows
> that the subselect doesn't depend on the FROM rows so it evaluates it
> on
I'm having trouble understanding why these two queries produce different
results:
test=# select (select random()) from generate_series(1,10); -- rows are the same
?column?
---
0.770797704812139
0.770797704812139
0.770797704812139
0.770797704812139
0.770797704812139