pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-sql@postgresql.org
Subject: Single vs. multiple indexes
Date: Thu, 09 Jul 1998 12:35:29 -0400
Message-ID: <2366.900002129@sss.pgh.pa.us> (raw)

Question: what's the difference between making a single index covering
multiple fields of the underlying table, and making a separate index
for each of the fields?

I understand that the semantics are different if I create a UNIQUE
index: a unique index on a field enforces that every record in the table
have a different value of that field, but a unique index on a set of
fields only enforces that the combination of all those fields be unique
in each record.

Leaving that aside, what are the performance implications?  Does one
structure support fast execution of query types that the other doesn't,
and if so which one's better for what?  Is a single index cheaper to
update than multiple indexes?  Does it save disk space?

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <2366.900002129@sss.pgh.pa.us>
Permalink:  ../2366.900002129@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2366.900002129@sss.pgh.pa.us

 · 

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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: Single vs. multiple indexes
  In-Reply-To: <2366.900002129@sss.pgh.pa.us>
  References: <2366.900002129@sss.pgh.pa.us>

* 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