Re: Arrays and foreign keys

From: Chris Bitmead <chrisb(at)nimrod(dot)itg(dot)telstra(dot)com(dot)au>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Kaare Rasmussen <kar(at)webline(dot)dk>, pgsql-hackers(at)postgresql(dot)org, Jan Wieck <janwieck(at)Yahoo(dot)com>
Subject: Re: Arrays and foreign keys
Date: 2000-08-11 01:19:59
Message-ID: 399354BF.C8BB662A@nimrod.itg.telecom.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2000-08-11 01:33:43 Re: Arrays and foreign keys
Previous Message Stephan Szabo 2000-08-11 01:03:16 Re: Arrays and foreign keys