Multicolumn Indexes

From: "Thomas Yagel" <tyagel(at)yahoo(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Multicolumn Indexes
Date: 2004-10-15 16:36:13
Message-ID: EOEFLPAIAEDLPGGLIIGNMEDHCJAA.tyagel@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a situtation where a particular table includes a timestamp column and
a id column. The query I am working with right now filters based on
timestamp and orders based on ID.

I have not found enough information about how multicolumn indexes actually
work to determine if one will help me in this case, but I think that it
might.

Right now the index that I have on timestamp is not used because the Primary
Key(ID) index is chosen for ordering. If I place a multicolumn index on
(timestamp, id) will that index be able to filter the timestamp and still be
used for returning the ordered IDs?

Also is there any documentation out there that provides more details about
the specific behavior of multi column indexes in Postgresql.

Thanks,
Thomas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Harding 2004-10-15 17:00:20 Re: creating audit tables
Previous Message Marco Colombo 2004-10-15 16:21:35 Re: Mathematical operations with NULL values