Re: Difference between UNIQUE constraint vs index

Поиск
Список
Период
Сортировка
Искать
От
John Jawed
Тема
Re: Difference between UNIQUE constraint vs index
Дата
Msg-id
a9eb35850702280925m480ae030n85754275860fefa1@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Difference between UNIQUE constraint vs index "John Jawed" <johnjawed@gmail.com>
Re: Difference between UNIQUE constraint vs index "Jim C. Nasby" <jim@nasby.net>
Re: Difference between UNIQUE constraint vs index Tom Lane <tgl@sss.pgh.pa.us>
Re: Difference between UNIQUE constraint vs index Ron Johnson <ron.l.johnson@cox.net>
Re: Difference between UNIQUE constraint vs index "Joshua D. Drake" <jd@commandprompt.com>
Re: Difference between UNIQUE constraint vs index Ron Johnson <ron.l.johnson@cox.net>
Re: Difference between UNIQUE constraint vs index "John Jawed" <johnjawed@gmail.com>
Re: Difference between UNIQUE constraint vs index "Brandon Aiken" <BAiken@winemantech.com>
Re: Difference between UNIQUE constraint vs index Tom Lane <tgl@sss.pgh.pa.us>
Re: Difference between UNIQUE constraint vs index "Brandon Aiken" <BAiken@winemantech.com>
Re: Difference between UNIQUE constraint vs index "John Jawed" <johnjawed@gmail.com>
Re: Difference between UNIQUE constraint vs index "Joshua D. Drake" <jd@commandprompt.com>
Informix:

http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqls.doc/sqls285.htm

AFAICS, Oracle as well.

John

On 2/28/07, Tom Lane  wrote:
> "Jim C. Nasby"  writes:
> > In some databases if you know that an index just happens to be unique
> > you might gain some query performance by defining the index as unique,
> > but I don't think the PostgreSQL planner is that smart.
>
> Actually, the planner only pays attention to whether indexes are unique;
> the notion of a unique constraint is outside its bounds.  In PG a unique
> constraint is implemented by creating a unique index, and so there is
> really not any interesting difference.
>
> I would imagine that other DBMSes also enforce uniqueness by means of
> indexes, because it'd be awful darn expensive to enforce the constraint
> without one; but I'm only guessing here, not having looked.  Can anyone
> point to a real system that enforces unique constraints without an
> underlying index?
>
>                         regards, tom lane
>
В списке pgsql-general по дате отправления
От: Tom Lane
Дата:
От: Merlin Moncure
Дата:
Сообщение: Re: SQL names for C constants
FAQ