From: | Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> |
---|---|
To: | Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> |
Cc: | Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>, sad <sad(at)bankir(dot)ru>, pgsql-sql(at)postgresql(dot)org |
Subject: | Re: tree structure photo gallery date quiery |
Date: | 2004-11-17 09:45:46 |
Message-ID: | Pine.GSO.4.61.0411171238110.11252@ra.sai.msu.su |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Wed, 17 Nov 2004, Achilleus Mantzios wrote:
> O Oleg Bartunov ?????? ???? Nov 17, 2004 :
>
>> Gary,
>>
>> if you need really fast solution for you task and dont't afraid
>> non-standard soltion, take a look on contrib/ltree module.
>> http://www.sai.msu.su/~megera/postgres/gist/ltree/
>>
>> Oleg
>
> Oleg how would you compare an ltree solution against a
> genealogical approach using intarray??
> i.e. store for each node, its path to root,
> e.g. path='{4,2,7}'::int4[] where 4 is the id of the father,
> 2 of the grandfather, and 7 of the root, whereas root has
> path is null.
> That way we can do really fast queries using ~, have indexes
> on level (path length),first (immediate ancestor),last (root)
> using C functions that we can easily write and so forth.
> I have extensively used this approach with success.
> Can you comment on the pros and cons of each? (int[] with intarray vs
> ltree).
well, internally both approaches are very much the same :)
if you don't need ltree features like human readable path
But I'd like to have some real numbers. Could you spent some time and
create test suite and compare genealogical approach and ltree ?
I'll add resuts to docs.
>
> Thanx
>> _____________________________________________________________
>> Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
>> Sternberg Astronomical Institute, Moscow University (Russia)
>> Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
>> phone: +007(095)939-16-83, +007(095)939-23-83
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 9: the planner will ignore your desire to choose an index scan if your
>> joining column's datatypes do not match
>>
>
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
From | Date | Subject | |
---|---|---|---|
Next Message | Achilleus Mantzios | 2004-11-17 10:00:32 | Re: tree structure photo gallery date quiery |
Previous Message | Oleg Bartunov | 2004-11-17 08:04:18 | Re: tree structure photo gallery date quiery |