Can this be indexed?

From: "Net Virtual Mailing Lists" <mailinglists(at)net-virtual(dot)com>
To: "Pgsql General" <pgsql-general(at)postgresql(dot)org>
Subject: Can this be indexed?
Date: 2004-11-06 14:34:01
Message-ID: 20041106143401.45@mail.net-virtual.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Thanks!

- Greg

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mario A. Soto Cordones 2004-11-06 15:02:54 Re: Retrieve ip client from postgres
Previous Message Tino Wildenhain 2004-11-06 14:10:35 Re: create a text file from postgres (like Oracle