Unix Technical Forum

nested set: algorithm for testing the integrity

This is a discussion on nested set: algorithm for testing the integrity within the MySQL forums, part of the Database Server Software category; --> I'm looking for a algorithm which checks if a nested set with many nodes and levels is correct. I ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 09:53 AM
alexander.buze@googlemail.com
 
Posts: n/a
Default nested set: algorithm for testing the integrity

I'm looking for a algorithm which checks if a nested set with many
nodes and levels is correct.

I know the pear class and I have read a few tutorials, maybe there is
a mathematical solution for this test?

thx.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 09:53 AM
lark
 
Posts: n/a
Default Re: nested set: algorithm for testing the integrity

alexander.buze@googlemail.com wrote:
> I'm looking for a algorithm which checks if a nested set with many
> nodes and levels is correct.
>
> I know the pear class and I have read a few tutorials, maybe there is
> a mathematical solution for this test?
>
> thx.
>


i think you're talking php.
check http://www.phpclasses.org


--
lark -- hamzee@sbcdeglobalspam.net
To reply to me directly, delete "despam".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 09:55 AM
--CELKO--
 
Posts: n/a
Default Re: nested set: algorithm for testing the integrity

>> algorithm which checks if a nested set with many nodes and levels is correct. <<

1) Buy a copy of TREES & HIERARCHIES IN SQL
2) Create a view called LftRgt which has all the lft and rgt values
unioned in it
3) No gaps in the numbering: (SELECT MAX(rgt) FROM Tree) = (SELECT
COUNT(*) FROM LftRgt)
4) No duplicated values: NOT EXISTS (SELECT seq FROM LftRgt GROUP BY
seq HAVING COUNT(*) > 1)
5) No overlapping (lft, rgt) pairs: an exercise for the reader


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:17 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com