Re: matrix encoding IS adjacency list

From: VC <boston103_at_hotmail.com>
Date: Tue, 20 Sep 2005 06:26:15 -0400
Message-ID: <X7-dnXc-q-FVfrLeRVn-vQ_at_comcast.com>


"Vadim Tropashko" <vadimtro_invalid_at_yahoo.com> wrote in message news:1127186304.410827.219810_at_g44g2000cwa.googlegroups.com...
>
> VC wrote:
>> "Vadim Tropashko" <vadimtro_invalid_at_yahoo.com> wrote in message
>> news:1127179828.730374.139640_at_g14g2000cwa.googlegroups.com...
>> > VC wrote:
>> > 'find tuples where prefix(materialized_path) = a.b
>> > and length(materialized_path)=3'
>> >
>> > which is not the same as
>> >
>> > 'find tuples where parent_id = 5'
>>
>> Come to think about it, you do not need the length, the m.p. query can
>> be
>> expressed as: 'find tuples where parent(materialized_path) =
>> parent_materialized_path', where parent(x) extracts the parent path by
>> removing the last path element. Of course, you'd create a
>> function-based
>> index to speed the query, as you would with a 'real' parent id. The
>> materialized path is an adjacency list ;)
>
> Which is equivalent to saying: "Let's represent a node with both
> materialized path and truncated path".

It's not. We do not need a separate colum, the parent id can be extracted from a node m.p. using a function ( 'parent(materialized_path)' ).

>Surely, there is a referential
> integrity constraint between these two columns. The point is that you
> artificially made that second column.
>
Received on Tue Sep 20 2005 - 12:26:15 CEST

Original text of this message