new module contrib/tree for 7.2 ? - Mailing list pgsql-hackers
From | Oleg Bartunov |
---|---|
Subject | new module contrib/tree for 7.2 ? |
Date | |
Msg-id | Pine.GSO.4.33.0201251644330.2837-100000@ra.sai.msu.su Whole thread Raw |
Responses |
Re: new module contrib/tree for 7.2 ?
Re: new module contrib/tree for 7.2 ? Re: new module contrib/tree for 7.2 ? Re: new module contrib/tree for 7.2 ? |
List | pgsql-hackers |
Hi, Is't late to submit new contrib module for 7.2 ? It's almost ready and tested, we have to write README.tree. New module creates new data types 'tree', 'treequery' for tree-like data and provides indexed access methods using Btree or GiST. Node represents as a path to the root, so record like '3.4' means 4-th child of 3-rd child of the root node. Due-to bit-representation there is a limitation to the number of children - 64 and defined in compile time (valid values - 8,16,32,64). For practical purposes 64 children looks quite enough. insert,delete operations should be ok, while move operations is a pain - one should update all paths of children nodes. But search is very fast, we use data from Open Directory catalog (www.dmoz.org) for testing: Select all countries: dmoz64=# explain analyze select * from dmoz where tid <* '18.*.0'; NOTICE: QUERY PLAN: Index Scan using tid_g_idx on dmoz (cost=0.00..1094.10 rows=277 width=100) (actual time=3.54..23.76 rows=56 loops=1) Total runtime: 23.96 msec EXPLAIN dmoz64=# name | strid | id | tid ---------------------+-------------------------------+--------+-------Tagalog | Top/World/Tagalog | 276537 | 18.18Taiwanese | Top/World/Taiwanese | 276566 | 18.19Tamil | Top/World/Tamil | 276567 | 18.20Telugu | Top/World/Telugu | 276568 | 18.21Thai | Top/World/Thai | 276601 | 18.22Ukrainian | Top/World/Ukrainian | 276602| 18.23Vietnamese | Top/World/Vietnamese | 276603 | 18.24Japanese | Top/World/Japanese | 268629 | 18.31Kiswahili | Top/World/Kiswahili | 268630 | 18.32Afrikaans | Top/World/Afrikaans | 256813 | 18.1Italiano | Top/World/Italiano | 266163 | 18.30Interlingua | Top/World/Interlingua | 266144 | 18.29Indonesia | Top/World/Indonesia | 265859 | 18.28Croatian | Top/World/Croatian | 257063 | 18.12 .................................................................... Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83
pgsql-hackers by date: