[GENERAL] Multiple unnests in query

Поиск
Список
Период
Сортировка
От Aron Widforss
Тема [GENERAL] Multiple unnests in query
Дата
Msg-id 1510536178.2747282.1170204616.4A024CB2@webmail.messagingengine.com
обсуждение исходный текст
Ответы Re: [GENERAL] Multiple unnests in query  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Good night,

Is this first query expected behavior? If so, what is the rationale? I
would have expected nine rows returned (as in my second example).

Regards,
Aron Widforss

SELECT unnest(ARRAY[1, 1, 2]) AS unnested1, unnest(ARRAY[3, 3, 4]) AS unnested2
;unnested1 | unnested2 
-----------+-----------        1 |         3        1 |         3        2 |         4
(3 rows)

SELECT unnest(ARRAY[1, 1, 2]) AS unnested1, sec
FROM (SELECT 3 AS sec UNION ALL     SELECT 3 AS sec UNION ALL     SELECT 4 AS sec) test
;unnested1 | sec 
-----------+-----        1 |   3        1 |   3        2 |   3        1 |   3        1 |   3        2 |   3        1 |
4        1 |   4        2 |   4
 
(9 rows)


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

В списке pgsql-general по дате отправления:

Предыдущее
От: Weiping Qu
Дата:
Сообщение: [GENERAL] ways of monitoring logical decoding performance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Multiple unnests in query