| От | Tom Lane |
|---|---|
| Тема | Re: DISTINCT on jsonb fields and Indexes |
| Дата | |
| Msg-id | 2093791.1592863254@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: DISTINCT on jsonb fields and Indexes (Michael Lewis <mlewis@entrata.com>) |
| Список | pgsql-general |
Michael Lewis <mlewis@entrata.com> writes:
>> In the example of "select distinct expression", the planner will never
>> notice that that expression has anything to do with an index.
> Thanks for that explanation. I assume re-writing as a 'group by' would have
> no bearing on that planner decision.
Hmm ... actually, now that you mention it, it might. Using GROUP BY
moves the expression into the category of "things we might want to
sort on", and we do pay attention to indexes for that. Trying it
just now, I find that I can get a index scan but not an index-only
scan for something like "select expr from tab group by expr".
Not sure if that will move the needle enough to help for the
original problem.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера