Re: Very slow 101-feeling design/query..

Поиск
Список
Период
Сортировка
От Rui DeSousa
Тема Re: Very slow 101-feeling design/query..
Дата
Msg-id 351E9FBA-1FF4-4A7B-BD78-ED60F36BA7F7@crazybean.net
обсуждение исходный текст
Ответ на Very slow 101-feeling design/query..  (Wells Oliver <wells.oliver@gmail.com>)
Список pgsql-admin


On Dec 10, 2021, at 5:53 PM, Wells Oliver <wells.oliver@gmail.com> wrote:

SELECT DISTINCT game_id FROM vw_joints

Seeing distinct makes me cringe; most uses of it foreshadow either a poor design or a bad query; not always but more often than not.

If you’re really trying to do a distinct you can select from the game table and do an exists against plays and joints tables thus removing the distinct clause; but I digress as the given query is most likely an over simplified query just as example.

Partitioning does nothing here as the query doesn’t filter on the partitioned field thus no partition elimination.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Very slow 101-feeling design/query..
Следующее
От: "Michel SALAIS"
Дата:
Сообщение: RE: Very slow 101-feeling design/query..