Categories > Your tips & tricks >

Lineage-based menu tree - no sub-query or recursion

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: TomH
Date: 2008-01-30
Time: 01:48

Lineage-based menu tree - no sub-query or recursion

Skrol29  inspired me to look beyond the current examples that use subqueries - and after much digging found this article which included a discussion of the "lineage" method - which I decided to implement because of it's obvious speed advantages - as fast as a single query flat file result.

The only disadvantage being that I would need to write the code to create the lineage term for each menu item. Turns out that I was able to do that in a single pass through the menu tree.

Please help yourself at http://tomhenry.us/tbs3/menu_tree/

I'll post the source code for the three programs as soon as I do some clean-up.
By: TomH
Date: 2008-01-30
Time: 14:17

Re: Lineage-based menu tree - no sub-query or recursion

Okay, the source code is now available at previously posted link.

Ideas for improvement would be would be greatly appreciated!

Have also conjured up a bulleted list version for those who always ask for that style ;)

Thanks for TBS,
TomH
By: TomH
Date: 2008-05-26
Time: 17:20

Hierarchical Menus - performance Re: Lineage-based menu tree - no sub-query or recursion

Okay,
I've added some script timers to see the speed of my "lineage based" Menu to the speed of traditional "sub-query" method of processing the tree data.

The timers are added to the bottom of the menus -- the original sub-query script is included for reference.

It appears that the sub-query method takes approx six (6) times longer to complete the menu build for my small menu tree.

All, including source, is shown at http://tomhenry.us/tbs3/

Cheers,