Re: UNIQUE predicate

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: UNIQUE predicate
Дата
Msg-id 4791.1025991173@sss.pgh.pa.us
обсуждение исходный текст
Ответ на UNIQUE predicate  (nconway@klamath.dyndns.org (Neil Conway))
Ответы Re: UNIQUE predicate  (nconway@klamath.dyndns.org (Neil Conway))
Список pgsql-patches
nconway@klamath.dyndns.org (Neil Conway) writes:
> The attached patch implements the SQL92 UNIQUE predicate.

The implementation seems to be well short of usefulness in a production
setting, for two reasons: (1) you're accumulating all the tuples into
memory --- what if they don't fit?  (2) the comparison step is O(N^2),
which renders the first point rather moot ... a test case large enough
to risk memory exhaustion will not complete in your lifetime.

I think a useful implementation will require work in the planner to
convert the UNIQUE predicate into a SORT/UNIQUE plan structure (somewhat
like the way DISTINCT is implemented, but we just want a boolean
result).

            regards, tom lane



В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Domain coercions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Wrap access to Oid II