Partial indexes - Mailing list pgsql-general

From elein
Subject Partial indexes
Date
Msg-id 20060418214815.GU20430@varlena.com
Whole thread Raw
Responses Re: Partial indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@varlena.com



pgsql-general by date:

Previous
From: "Ploski, Karen L"
Date:
Subject: PostgreSQL and the OCFS2 filesystem
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL and the OCFS2 filesystem