Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Is unique index always used if query is on first constituent column ?



Bruno Wolff III <bruno(at)wolff(dot)to> writes:
>   Rajesh Kumar Mallah <mallah(dot)rajesh(at)gmail(dot)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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group