| From: | Heikki Linnakangas <heikki(at)enterprisedb(dot)com> |
|---|---|
| To: | adrobj <adrobj(at)yahoo(dot)com> |
| Cc: | pgsql-performance(at)postgresql(dot)org |
| Subject: | Re: Clustered/covering indexes (or lack thereof :-) |
| Date: | 2007-11-16 19:33:07 |
| Message-ID: | 473DF073.1000503@enterprisedb.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
adrobj wrote:
> This is probably a FAQ, but I can't find a good answer...
>
> So - are there common techniques to compensate for the lack of
> clustered/covering indexes in PostgreSQL? To be more specific - here is my
> table (simplified):
>
> topic_id int
> post_id int
> post_text varchar(1024)
>
> The most used query is: SELECT post_id, post_text FROM Posts WHERE
> topic_id=XXX. Normally I would have created a clustered index on topic_id,
> and the whole query would take ~1 disk seek.
>
> What would be the common way to handle this in PostgreSQL, provided that I
> can't afford 1 disk seek per record returned?
You can cluster the table, see
http://www.postgresql.org/docs/8.2/interactive/sql-cluster.html.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jeff Davis | 2007-11-16 19:34:36 | Re: Clustered/covering indexes (or lack thereof :-) |
| Previous Message | Jonah H. Harris | 2007-11-16 16:06:11 | Re: PostgreSQL vs MySQL, and FreeBSD |