ARRAY(subquery) volatility
| От | Michael Fuhr |
|---|---|
| Тема | ARRAY(subquery) volatility |
| Дата | |
| Msg-id | 20050816060414.GA6540@winnie.fuhr.org обсуждение исходный текст |
| Ответы |
Re: ARRAY(subquery) volatility
Re: ARRAY(subquery) volatility |
| Список | pgsql-hackers |
Why does the first query below return the same value for each row
while the second query returns random values? Planner optimization?
test=> SELECT ARRAY(SELECT random()) FROM generate_series(1, 5); ?column?
---------------------{0.269273371561092}{0.269273371561092}{0.269273371561092}{0.269273371561092}{0.269273371561092}
(5 rows)
test=> SELECT ARRAY(SELECT random() + x * 0) FROM generate_series(1, 5) AS g(x); ?column?
---------------------{0.826863945846848}{0.42534113182935}{0.36419924318986}{0.258920902972538}{0.843205466327819}
(5 rows)
--
Michael Fuhr
В списке pgsql-hackers по дате отправления: