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.