Re: Indexes on individual columns of composite primary key

From: Matthew Walden <matthew(dot)walden(dot)list(at)gmail(dot)com>
To: Dann Corbit <DCorbit(at)connx(dot)com>
Cc: Dan Halbert <halbert(at)halwitz(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Indexes on individual columns of composite primary key
Date: 2010-11-15 20:36:47
Message-ID: AANLkTikSeBK9Nehdo06O0o=ujCirYcFCthGSCDx=E0yJ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Apparently (after reading the documentation link provided by Tom) there can
be value to indexes when accessed with leading columns missing".

That is a new one on me too - interesting.

I suppose it comes down to testing at the end of the day - if you "set
enable_seqscan to false" and "EXPLAIN ANALYSE" your query then you will see
whether the indexes you create are used. Whether they are useful will
require you to set enable_seqscan back to true and see whether the optimizer
chooses to use them (but that will change as your data does).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Jennings 2010-11-15 21:12:19 Re: Expected frequency of auto_vacuum activity
Previous Message Gauthier, Dave 2010-11-15 20:25:48 v9 deployment advise