Re: Using union to avoid creating temp table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Using union to avoid creating temp table
Дата
Msg-id 15083.1025543850@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Using union to avoid creating temp table  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-sql
Bruno Wolff III <bruno@wolff.to> writes:
> What I ended up doing is building the input values into sepearte
> select statements unioned together. So if the input values were
> 'abc', 'def' and 'ghi', I would end up doing a select like:
> select add.id from (select 'abc' union select 'def' union select 'ghi') add (id)where not exists (select from role
whereadd.id = role.id)
 

Might be worth writing "union all" not "union".  This suppresses union's
check for duplicated rows, which you presumably don't need.
        regards, tom lane




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

Предыдущее
От: "Simeone, Mario"
Дата:
Сообщение: unsubscribe
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: pg_restore cannot restore function