Re: [ADMIN] Q: Structured index - which one runs faster? - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: [ADMIN] Q: Structured index - which one runs faster?
Date
Msg-id 20030523165020.GA11094@wolff.to
Whole thread Raw
In response to Re: [ADMIN] Q: Structured index - which one runs faster?  (Vivek Khera <khera@kcilink.com>)
List pgsql-general
On Fri, May 23, 2003 at 11:09:00 -0400,
  Vivek Khera <khera@kcilink.com> wrote:
> A related question:
>
> Are any of these indexes redundant:
>
>  CREATE UNIQUE INDEX user_list_id_email ON user_list (owner_id,user_email);
>  CREATE INDEX user_list_owner_id ON user_list (owner_id);
>  CREATE INDEX user_list_oid_created ON user_list (owner_id,user_created);
>
> In particular, is user_list_owner_id redundant to
> user_list_oid_created?  Will the latter be used for queries such as

Yes. Any prefix of a multicolumn index can be used for queries. They
(prefixes) won't be usable by foreign key references because even if the
index as a whole is unique, the prefixes won't necessarily be.

pgsql-general by date:

Previous
From: Reece Hart
Date:
Subject: Re: Q: Structured index - which one runs faster?
Next
From: "scott.marlowe"
Date:
Subject: Re: caching query results