pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Vivek Khera <khera@kcilink.com>
Cc: pgsql-general@postgresql.org
Subject: Re: [ADMIN] Q: Structured index - which one runs faster?
Date: Fri, 23 May 2003 11:50:20 -0500
Message-ID: <20030523165020.GA11094@wolff.to> (raw)
In-Reply-To: <x7ptm94s4z.fsf@yertle.int.kciLink.com>
References: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at>
	<11951.1053643980@sss.pgh.pa.us>
	<x7ptm94s4z.fsf@yertle.int.kciLink.com>

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.



view thread (14+ messages)  latest in thread

Message-ID: <20030523165020.GA11094@wolff.to>
Permalink:  ../20030523165020.GA11094@wolff.to/
Also on:    postgresql.org/message-id/20030523165020.GA11094@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: bruno@wolff.to, khera@kcilink.com, pgsql-general@postgresql.org
  Subject: Re: [ADMIN] Q: Structured index - which one runs faster?
  In-Reply-To: <20030523165020.GA11094@wolff.to>
  References: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at> <11951.1053643980@sss.pgh.pa.us> <x7ptm94s4z.fsf@yertle.int.kciLink.com> <20030523165020.GA11094@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox