Re: Re : Re : Query "top 10 and others"

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Re : Re : Query "top 10 and others"
Дата
Msg-id CAHyXU0xdvo0GesOxcAPGz=g+1b0MiED_4bRyxEWk2Pn27aqeDA@mail.gmail.com
обсуждение исходный текст
Ответ на Re : Re : Query "top 10 and others"  (Edson Richter <edsonrichter@hotmail.com>)
Список pgsql-general
On Sat, Jul 5, 2014 at 8:12 AM, Edson Richter <edsonrichter@hotmail.com> wrote:
> Thanks!
>
> I'll investigate (explain) performance for both versions.

also be advised that in most cases when you use SQL 'UNION' you really
should be using 'UNION ALL'.  It's a very common mistake:

UNION: form proper set union, combine set and remove tuple duplicates
UNION ALL: append two sets

For large sets, the duplicate removal can be expensive and possibly
introduce subtle data dependent bugs in the worst case.

merlin


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

Предыдущее
От: Kynn Jones
Дата:
Сообщение: Re: Random-looking primary keys in the range 100000..999999
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: Random-looking primary keys in the range 100000..999999