Re: Return rows in input array's order?

Поиск
Список
Период
Сортировка
От David Wheeler
Тема Re: Return rows in input array's order?
Дата
Msg-id BAC27EA4-B883-4C12-AF6A-BAD76ADE5F28@gmail.com
обсуждение исходный текст
Ответ на Re: Return rows in input array's order?  (Dominique Devienne <ddevienne@gmail.com>)
Ответы Re: Return rows in input array's order?
Список pgsql-general
>> It was only used for small arrays but never noticed any performance issues
>
> Hmmm, sounds like this would be quadratic though...

True, but it’s cpu time not io, which tends to be orders of magnitude slower

> I wonder whether the int[] can be turned into a pseudo table with a ROWNUM extra generated column that
> would then be (LEFT) JOIN'd to the accessed table, so that the original array index is readily accessible.
> Would something like this be possible in Postgres' SQL?

The unnest function mentioned above has a “with ordinality” option which gives easy access to the array index so a
simplejoin would do the trick 



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

Предыдущее
От: negora
Дата:
Сообщение: Re: Return rows in input array's order?
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: ICU, locale and collation question