pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vivek Khera <khera@kcilink.com>
To: pgsql-general@postgresql.org
Subject: Re: [ADMIN] Q: Structured index - which one runs faster?
Date: 23 May 2003 11:09:00 -0400
Message-ID: <x7ptm94s4z.fsf@yertle.int.kciLink.com> (raw)
References: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at>
	<11951.1053643980@sss.pgh.pa.us>

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

 SELECT user_fname from user_list where owner_id=34

If so, I can drop the owner_id index.  the _id columns are integers,
created is a datetime, and email is a string.  owner_id is also a
foreign key into the owners table (via REFERENCES), if that matters.

I'd try it out by dropping the index, but reindexing it takes a *LONG*
time which I cannot afford to be unavailable.

Thanks.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/



view thread (14+ messages)  latest in thread

Message-ID: <x7ptm94s4z.fsf@yertle.int.kciLink.com>
Permalink:  ../x7ptm94s4z.fsf@yertle.int.kciLink.com/
Also on:    postgresql.org/message-id/x7ptm94s4z.fsf@yertle.int.kciLink.com

 · 

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: khera@kcilink.com, pgsql-general@postgresql.org
  Subject: Re: [ADMIN] Q: Structured index - which one runs faster?
  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>

* 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