Search Postgresql Archives

Re: Partial indexes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 19, 2006 at 03:51:27AM +0200, Florian G. Pflug wrote:
> Tom Lane wrote:
> >elein <elein@xxxxxxxxxxx> writes:
> >>I think I want to:
> >>	create unique index pk on table tbl (keyp1, keyp2);
> don't you want
> create unique inde pk on table tbl (keyp1, keyp2) where keyp3 is null
> here?
> 
> >>	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?
> 
> greetings, Florian Pflug
> 

Yes, you are right. I ended up creating a unique constraint on the three
parts of the key and a unique index on keyp1, keyp2 where keyp3 is null.
I think this will cover all cases as simply as possible.

Thanks,

--elein
elein@xxxxxxxxxxx


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux