Re: Arrays and foreign keys

Поиск
Список
Период
Сортировка
От Chris Bitmead
Тема Re: Arrays and foreign keys
Дата
Msg-id 399354BF.C8BB662A@nimrod.itg.telecom.com.au
обсуждение исходный текст
Ответ на Re: Arrays and foreign keys  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: Arrays and foreign keys  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-hackers
Stephan Szabo wrote:

> But (and this is a really big but) -- This is going to be slow as hell,
> and perhaps slower than that, since for any update or delete, you would
> have to go through every row on the other table doing the array in until
> we can get an index on all the elements in all of the arrays.
> 
> Then there are other problematic issues like:
> {1,2,3} -> {1,3,4} -- Is this a delete of 2 and an insert of 4 or
>                       two updates?
> {1,2,3} -> {3,4,1} -- What about this one?

Probably the only useful use of arrays in conjunction with referential
integrity is to treat the array as an unordered collection.  

{1,2,3} -> {1,3,4} -- Is a delete of 2 and an insert of 4.                    
{1,2,3} -> {3,4,1} -- Is a delete of 2 and an insert of 4.

For that reason I'm not sure that it has to be slow. When an array is
updated find the elements that have changed (according to the above
definition of changed) and only check on those ones.


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Arrays and foreign keys
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Arrays and foreign keys