Re: Can this be indexed?
От | Net Virtual Mailing Lists |
---|---|
Тема | Re: Can this be indexed? |
Дата | |
Msg-id | 20041106154904.10628@mail.net-virtual.com обсуждение исходный текст |
Ответ на | Can this be indexed? ("Net Virtual Mailing Lists" <mailinglists@net-virtual.com>) |
Ответы |
Re: Can this be indexed?
Re: Can this be indexed? |
Список | pgsql-general |
I am not clear how to use a trigger for this, I will need to look into that.... It is my understanding that Postgres does not have materialized views though (which I believe would solve this problem nicely) - am I mistaken?... - Greg >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'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. > >I don't think that a rule could come useful in this case. IMHO you could >use triggers or a materialized view to store the results and speed up >things. > > >Best regards >-- >Matteo Beccati >http://phpadsnew.com/ >http://phppgads.com/ >
В списке pgsql-general по дате отправления: