Re: Can this be indexed? - Mailing list pgsql-general

From Net Virtual Mailing Lists
Subject Re: Can this be indexed?
Date
Msg-id 20041106154904.10628@mail.net-virtual.com
Whole thread Raw
In response to Can this be indexed?  ("Net Virtual Mailing Lists" <mailinglists@net-virtual.com>)
Responses Re: Can this be indexed?
Re: Can this be indexed?
List 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 by date:

Previous
From: "Ed L."
Date:
Subject: superuser equality
Next
From: "Net Virtual Mailing Lists"
Date:
Subject: Temporarily disable rule, is this possible?