pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruno Wolff III <bruno@wolff.to>
Cc: Rajesh Kumar Mallah <mallah.rajesh@gmail.com>
Cc: Lista Postgres <pgsql-admin@postgresql.org>
Subject: Re: Is unique index always used if query is on first constituent column ?
Date: Sat, 30 Dec 2006 13:06:50 -0500
Message-ID: <13436.1167502010@sss.pgh.pa.us> (raw)
In-Reply-To: <20061230171528.GA2803@wolff.to>
References: <a97c77030612300238j47f7e52bxb23fe644f0046094@mail.gmail.com>
	<20061230171528.GA2803@wolff.to>

Bruno Wolff III <bruno@wolff.to> writes:
>   Rajesh Kumar Mallah <mallah.rajesh@gmail.com> wrote:
>> create unique index ab on t(a,b);
>> create index b on t(b);

> If the b data is large you might get some performance increase from adding
> an index on just a. You will be trading off increased work when doing updates
> to handle the extra index versus faster searches in a more compact index.

This is covered in some detail in TFM:
http://www.postgresql.org/docs/8.2/static/indexes-multicolumn.html
http://www.postgresql.org/docs/8.2/static/indexes-bitmap-scans.html

			regards, tom lane



view thread (3+ messages)

Message-ID: <13436.1167502010@sss.pgh.pa.us>
Permalink:  ../13436.1167502010@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13436.1167502010@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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bruno@wolff.to, mallah.rajesh@gmail.com
  Subject: Re: Is unique index always used if query is on first constituent column ?
  In-Reply-To: <13436.1167502010@sss.pgh.pa.us>
  References: <a97c77030612300238j47f7e52bxb23fe644f0046094@mail.gmail.com> <20061230171528.GA2803@wolff.to> <13436.1167502010@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