| От | Ed L. |
|---|---|
| Тема | Re: Can this be indexed? |
| Дата | |
| Msg-id | 200411060930.30859.pgsql@bluepolka.net обсуждение исходный текст |
| Ответ на | Can this be indexed? ("Net Virtual Mailing Lists" <mailinglists@net-virtual.com>) |
| Список | pgsql-general |
On Saturday November 6 2004 7:34, Net Virtual Mailing Lists wrote: > Is there a way to create an index that would make this query be efficient > and not perform a sequential scan? > > SELECT count(*) AS count,id FROM sometable GROUP BY id; > > .. I've considered creating a rule on this table which would put the > results of this into another table anytime it is updated, but I thought > there might be an easier way. Since you have no "WHERE" clause and you want to group by id, I believe pgsql has to scan all id values. Those id values are only fully stored in the table, so I don't think so. Ed
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера