> > Would a rule be that
> > if the first attribute of an index is unique, then additional
> > attributes are basically useless?
> For PostgreSQL this is currently true, since indexes are currently not
> used for order by. If you have a unique first column in an index,
> then all following columns could only be used for sorting,
> not for faster access (access actually gets worse).
The rule 'if the first attribute of an index is unique, then additional
attributes are basically useless' is exactly correct for all systems, not
just PostgreSQL. It has nothing to do with whether indexes are used for
A bit of thought will reveal that if the first key is unique then there
is no way any subsequent key can influence the sort order. Consider:
There is no value you can put in col2 that will make 'A' sort after 'B'.
David Gould dg(at)illustra(dot)com 510.628.3783 or 510.305.9468
Informix Software (No, really) 300 Lakeside Drive Oakland, CA 94612
"Of course, someone who knows more about this will correct me if I'm wrong,
and someone who knows less will correct me if I'm right."
--David Palmer (palmer(at)tybalt(dot)caltech(dot)edu)
In response to
pgsql-hackers by date
|Next:||From: teunis||Date: 1998-03-30 19:53:58|
|Previous:||From: Bruce Momjian||Date: 1998-03-30 18:35:34|
|Subject: Re: AW: [HACKERS] Re: Let's talk up 6.3|