Partial indexes

From: elein <elein(at)varlena(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: elein <elein(at)varlena(dot)com>
Subject: Partial indexes
Date: 2006-04-18 21:48:16
Message-ID: 20060418214815.GU20430@varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


In 8.1.2.

Table contains columns:
keyp1 not null, keyp2 not null, keyp3 nullable.

The queries will be separated into two kinds:
one on those rows where keyp3 is null and
the second on where keyp3 is not null.

I think I want to:
create unique index pk on table tbl (keyp1, keyp2);
create unique index range on table tbl (keyp1, keyp2, keyp3) where keyp3 is not null;

Are these indexes redundant given uniqueness requirement and the type of queries
that will be run against the table? I don't think a non-unique index over
all three columns be adequate given the uniqueness constraints.

Opinions?

Thanks,

elein
elein(at)varlena(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-04-18 22:05:58 Re: PostgreSQL and the OCFS2 filesystem
Previous Message Ploski, Karen L 2006-04-18 20:30:32 PostgreSQL and the OCFS2 filesystem