nested set: algorithm for testing the integrity

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


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-23-2007
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.

Reply With Quote
  #2 (permalink)  
Old 05-23-2007
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".
Reply With Quote
  #3 (permalink)  
Old 05-25-2007
--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


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0