Re: Can this be indexed?

Поиск
Список
Период
Сортировка
От Brent Wood
Тема Re: Can this be indexed?
Дата
Msg-id 20041108092555.M64803@storm-user.niwa.co.nz
обсуждение исходный текст
Ответ на Re: Can this be indexed?  ("Net Virtual Mailing Lists" <mailinglists@net-virtual.com>)
Список pgsql-general

>
> >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;
> >
> >Indexes cannot be used for retrieving results...

I'm not sure if it would improve performance at all, given the entire
table needs to be scanned anyway, but add a where clause "where id > 0"
should allow an index on id to be used.

Possibly a bit like speeding up "select max(id) from ..."

Someone who knows more about the internals of Postgis can prob comment on
the validity/idiocy of this suggestion :-)

Brent Wood

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

Предыдущее
От: "Devin L. Ganger"
Дата:
Сообщение: Re: Postresql RFD version 2.0 Help Wanted.
Следующее
От: Brent Wood
Дата:
Сообщение: Re: Can this be indexed?