Re: Questions about indexes?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Questions about indexes?
Дата
Msg-id 2557.1045466127@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Questions about indexes?  (Ryan Bradetich <rbradetich@uswest.net>)
Ответы Re: Questions about indexes?  (Ryan Bradetich <rbradetich@uswest.net>)
Список pgsql-hackers
Ryan Bradetich <rbradetich@uswest.net> writes:
> On Sun, 2003-02-16 at 23:34, Tom Lane wrote:
>> It's not real clear to me why you bother enforcing a constraint that the
>> complete row be unique.  Wouldn't a useful constraint be that the first
>> three columns be unique?

> The table holds system policy compliance data.  The catagory is
> basically the policy, and the anomaly is the detailed text explaining
> why the system is out of compliance.  So the anomaly data is important
> (and often the reason why the key is unique).

Well, sure the anomaly is important: it's the payload, the reason why
you bother to have the table in the first place.  But that doesn't mean
it's part of the key.  Generally the key would be the info you use to
look up a particular anomaly text.  In this example, it's not clear to
me why you'd need/want two different anomaly texts entered for the same
host_id and the same category at the same instant of time.  ISTM there's
something inadequate about your category column if you need that.
        regards, tom lane


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

Предыдущее
От: Ryan Bradetich
Дата:
Сообщение: Re: Questions about indexes?
Следующее
От: Ryan Bradetich
Дата:
Сообщение: Re: Questions about indexes?