Re: SELECT...VIEW...UNION...LIMIT

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: SELECT...VIEW...UNION...LIMIT
Дата
Msg-id 873byy3294.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на SELECT...VIEW...UNION...LIMIT  ("Ed L." <pgsql@bluepolka.net>)
Список pgsql-general
"Ed L." <pgsql@bluepolka.net> writes:

>     create view big_view as
>         select *, 'big_table'::varchar as source from big_table
>         union
>         select *, 'small_table'::varchar as source from small_table;

Try "UNION ALL" instead of just "union"

The difference is that union has to avoid duplicates. If you want duplicates
to be included or know for certain there will be no duplicates then union all
is faster.

--
greg

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

Предыдущее
От: "Edmund Kleiser"
Дата:
Сообщение: select into temp tables withough using EXECUTE in plpgsql
Следующее
От: JM
Дата:
Сообщение: HELP speed up my Postgres