Re: Apply LIMIT when computation is logically irrelevant

Поиск
Список
Период
Сортировка
От Michael Lewis
Тема Re: Apply LIMIT when computation is logically irrelevant
Дата
Msg-id CAHOFxGqETwver1DDy-pcZT3+Z8fw+yyiuLwCC-rNAF1rA9ayqg@mail.gmail.com
обсуждение исходный текст
Ответ на Apply LIMIT when computation is logically irrelevant  (Robins Tharakan <tharakan@gmail.com>)
Список pgsql-general
On Mon, Jul 6, 2020 at 5:37 AM Robins Tharakan <tharakan@gmail.com> wrote:
This need came up while reviewing generated SQL, where the need was to return true when
at least one of two lists had a row.

Generated SQL... yep. That will happen. Manual SQL may be more work, but often has significant reward.

If you can change how the SQL is generated, I would expect that EXISTS would likely be more performant in your case, even if you need to do UNION ALL between the two current queries that potentially return true.

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

Предыдущее
От: Sebastien Arod
Дата:
Сообщение: Is postgres able to share sorts required by common partition window functions?
Следующее
От: Michael Lewis
Дата:
Сообщение: Re: Is postgres able to share sorts required by common partition window functions?