Re: More pain and sufferring with Tropashko's materialized path...
From: Vadim Tropashko <vadimtro_at_yho.cm>
Date: Tue, 11 Nov 2003 18:34:58 -0800
Message-ID: <T8hsb.30$Up4.151_at_news.oracle.com>
>
>
> SQL> select log(2, path_numer('1.2.4')- path_denom('1.2.4')+1) from dual
>
> Wrong:
>
> LOG(2,PATH_NUMER('1.2.4')-PATH_DENOM('1.2.4')+1)
> ------------------------------------------------
> 5.169925
>
> which was expected to be 3.
Date: Tue, 11 Nov 2003 18:34:58 -0800
Message-ID: <T8hsb.30$Up4.151_at_news.oracle.com>
Mikito Harakiri wrote:
> "Vadim Tropashko" <vadimtro_at_yho.cm> wrote in message
> news:HGasb.25$Up4.55_at_news.oracle.com...
>
>> >>And NUMER = DENOM + 2^LEVEL - 1.
>
>
> SQL> select log(2, path_numer('1.2.4')- path_denom('1.2.4')+1) from dual
>
> Wrong:
>
> LOG(2,PATH_NUMER('1.2.4')-PATH_DENOM('1.2.4')+1)
> ------------------------------------------------
> 5.169925
>
> which was expected to be 3.
That's right, there seem to be no simple identity involving level:-( Here is, however, another nice identity
N = NUMER - (DENOM+1)/4 where N is the encoding in the new schema.
SQL> select N, path(normalize_numer(numer,de
normalize_denom(numer,denom)) as PATH
normalize_numer(numer,denom) num,
normalize_denom(numer,denom) den,
normalize_numer(numer,denom)+1)/4 + N
- normalize_denom(numer,denom) AS diff
from (
select N, x_num(N)*y_den(N)+y_num(N)*x_den(
x_den(N)*y_den(N) denom from (
/* integer table */
select rownum N from sys.obj$ where rownun < 100
)
);
N PATH NUM DEN DIFF
---------- --------------- ---------- ---------- --
1 .1 3 2 0
2 .1.1 7 4 0
3 .2 3 4 0
4 .1.1.1 15 8 0
5 .1.2 11 8 0
6 .2.1 7 8 0
7 .3 3 8 0
8 .1.1.1.1 31 16 0
9 .1.1.2 27 16 0
10 .1.2.1 23 16 0
11 .1.3 19 16 0
12 .2.1.1 15 16 0
13 .2.2 11 16 0
14 .3.1 7 16 0
15 .4 3 16 0
16 .1.1.1.1.1 63 32 0
17 .1.1.1.2 59 32 0
18 .1.1.2.1 55 32 0
19 .1.1.3 51 32 0
20 .1.2.1.1 47 32 0
21 .1.2.2 43 32 0
22 .1.3.1 39 32 0
23 .1.4 35 32 0
24 .2.1.1.1 31 32 0
25 .2.1.2 27 32 0
26 .2.2.1 23 32 0
27 .2.3 19 32 0
28 .3.1.1 15 32 0
29 .3.2 11 32 0
30 .4.1 7 32 0
31 .5 3 32 0
32 .1.1.1.1.1.1 127 64 0
33 .1.1.1.1.2 123 64 0
34 .1.1.1.2.1 119 64 0
35 .1.1.1.3 115 64 0
36 .1.1.2.1.1 111 64 0
37 .1.1.2.2 107 64 0
38 .1.1.3.1 103 64 0
39 .1.1.4 99 64 0
40 .1.2.1.1.1 95 64 0
41 .1.2.1.2 91 64 0
42 .1.2.2.1 87 64 0
43 .1.2.3 83 64 0
44 .1.3.1.1 79 64 0
45 .1.3.2 75 64 0
46 .1.4.1 71 64 0
47 .1.5 67 64 0
48 .2.1.1.1.1 63 64 0
49 .2.1.1.2 59 64 0
50 .2.1.2.1 55 64 0
51 .2.1.3 51 64 0
52 .2.2.1.1 47 64 0
53 .2.2.2 43 64 0
54 .2.3.1 39 64 0
55 .2.4 35 64 0
56 .3.1.1.1 31 64 0
57 .3.1.2 27 64 0
58 .3.2.1 23 64 0
59 .3.3 19 64 0
60 .4.1.1 15 64 0
61 .4.2 11 64 0
62 .5.1 7 64 0
63 .6 3 64 0
64 .1.1.1.1.1.1.1 255 128 0
65 .1.1.1.1.1.2 251 128 0
66 .1.1.1.1.2.1 247 128 0
67 .1.1.1.1.3 243 128 0
68 .1.1.1.2.1.1 239 128 0
69 .1.1.1.2.2 235 128 0
70 .1.1.1.3.1 231 128 0
71 .1.1.1.4 227 128 0
72 .1.1.2.1.1.1 223 128 0
73 .1.1.2.1.2 219 128 0
74 .1.1.2.2.1 215 128 0
75 .1.1.2.3 211 128 0
76 .1.1.3.1.1 207 128 0
77 .1.1.3.2 203 128 0
78 .1.1.4.1 199 128 0
79 .1.1.5 195 128 0
80 .1.2.1.1.1.1 191 128 0
81 .1.2.1.1.2 187 128 0
82 .1.2.1.2.1 183 128 0
83 .1.2.1.3 179 128 0
84 .1.2.2.1.1 175 128 0
85 .1.2.2.2 171 128 0
86 .1.2.3.1 167 128 0
87 .1.2.4 163 128 0
88 .1.3.1.1.1 159 128 0
89 .1.3.1.2 155 128 0
90 .1.3.2.1 151 128 0
91 .1.3.3 147 128 0
92 .1.4.1.1 143 128 0
93 .1.4.2 139 128 0
94 .1.5.1 135 128 0
95 .1.6 131 128 0
96 .2.1.1.1.1.1 127 128 0
97 .2.1.1.1.2 123 128 0
98 .2.1.1.2.1 119 128 0
99 .2.1.1.3 115 128 0
Received on Wed Nov 12 2003 - 03:34:58 CET
