Re: Different result behavior when using ANY(ARRAY(SELECT)) and IN (SELECT)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Different result behavior when using ANY(ARRAY(SELECT)) and IN (SELECT)
Дата
Msg-id 1974195.1604934630@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Different result behavior when using ANY(ARRAY(SELECT)) and IN (SELECT)  (Davide Jensen <d.jensen@tecnoteca.com>)
Ответы Re: Different result behavior when using ANY(ARRAY(SELECT)) and IN (SELECT)  (Davide Jensen <d.jensen@tecnoteca.com>)
Список pgsql-general
Davide Jensen <d.jensen@tecnoteca.com> writes:
> I'm encountering some problems in understanding the behavior of a query
> that uses an IN operator, the query i'm executing is the following:

> SELECT * FROM   (
>               SELECT _id,
>                      ROW_NUMBER() OVER () AS _rownumber

I think your problem is in the above, not anything later in the query.
ROW_NUMBER without any ordering specification is indeterminate.
If the query gets parallelized, it's no surprise that the selected rows
will be processed in varying order from one try to the next.  Your
second phrasing of the query seems to be non-parallelizable, but the
row_number() result is still pretty indeterminate; it just doesn't
happen to have changed within your test run.

What is it you are expecting to get out of including a fictional
row number in the query result, anyway?

            regards, tom lane



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Database system was interrupted. Possible reasons for a database to suddenly stop accepting connections?
Следующее
От: David Gauthier
Дата:
Сообщение: database aliasing options ?