| От | Thomas Kellerer |
|---|---|
| Тема | Re: JOIN on partitions is very slow |
| Дата | |
| Msg-id | 7cdfd0d6-e4d3-7351-f13c-696460853657@gmx.net обсуждение исходный текст |
| Ответ на | Re: JOIN on partitions is very slow (Michael Lewis <mlewis@entrata.com>) |
| Ответы |
Re: JOIN on partitions is very slow
|
| Список | pgsql-performance |
Michael Lewis schrieb am 23.03.2020 um 17:16: > Yes. I can tweak the query. Version of postgres is 9.5.15. I have > about 20 partitions for company_sale_account table. I do have an > index on company name. > > I need to use DISTINCT as i need to remove the duplicates. > > > DISTINCT is a sign of improper joins most of the time in my > experience. Often, just changing to group by is faster As none of the columns of the joined table are used, most probably this should be re-written as an EXISTS condition. Then neither GROUP BY nor DISTINCT is needed.
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера