Re: In an RDBMS, what does "Data" mean?
Date: Sat, 10 Jul 2004 00:35:38 +0100
Message-ID: <33BjwOOKvy7AFwni_at_thewolery.demon.co.uk>
In message <j6CDc.101024$2i5.34223_at_attbi_s52>, Marshall Spight
<mspight_at_dnai.com> writes
>> Let's put a new element 'N' into
>> the list, right after the 'B':
>>
>> The new list is [A, B, N, C].
>> Now what is the set?
>>
>> is it UC1: { (1, A), (2, B), (3, C), (2.5, N) } or
>> is it UC2: { (1, A), (2, B), (4, C), (3, N) } ?
>
>It's UC2.
>
Why? (Okay, I do agree with you. But why?) I think it's because your
ordering column is actually "list position" which by definition must be
a sequential integer. But that column could equally be defined as
"relative position" in which case UC1 would be fine.
>
>> In the case of UC2 every insert causes updates to
>> all elements that should be after the new element.
>
>Let us also consider the two other common implementations
>of lists: linked lists and arrays.
>
>In UC2, an insert requires O(N) time: every index above
>the one inserted requires updating. In a linked list, an insert
>requires O(1) time, but locating an item in order to insert in
>front of it is O(N). In an array, an insert requires O(N) time,
>because you have to move all the higher elements up.
>
>The issue here is not performance, it's interface. Using SQL
>to manipulate ordered data *where the ordering is positional*
>and *not by any logical component of the data* is just way
>too hard.
Is it "way too hard" or is it simply because the underlying relational
model has no concept of order? You cannot manipulate something that has
no conceptual existence.
>
>"Lists are very common, and SQL doesn't handle them well at all.
>RM doesn't handle them well either."
:-)
>
>Let me expand on what I mean by "handle," and to do so,
>I'll use the "structure, integrity, manipulation" definition of
>a DBMS.
Of a DBMS, or the relational version of that definition?
Cheers,
Wol
-- Anthony W. Youngman - wol at thewolery dot demon dot co dot uk HEX wondered how much he should tell the Wizards. He felt it would not be a good idea to burden them with too much input. Hex always thought of his reports as Lies-to-People. The Science of Discworld : (c) Terry Pratchett 1999Received on Sat Jul 10 2004 - 01:35:38 CEST