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: difference between a unique constraint and a unique index ???




On 12-Nov-07, at 11:37 AM, Tom Lane wrote:

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
Well, AFAIK the index with varchar_pattern_ops is used for LIKE queries, whereas the other one is going to be used for = queries. So you need to
keep both indexes.

Given the current definition of text equality, it'd be possible to drop
~=~ and have the standard = operator holding the place of equality in
both the regular and pattern_ops opclasses.  Then it'd be possible to
support regular equality queries, as well as LIKE, with only the
pattern_ops index.

That would be ideal. Having two indexes on the same column isn't optimal.

Dave



Home | Main Index | Thread Index

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