[development] The new menu system

Chris Johnson chris at tinpixel.com
Fri Sep 29 18:54:55 UTC 2006

adrian rossouw wrote:

> Secondly, I don't feel that chx actually explained this correctly, but 
> we store the generated menu items, into a normalised database table.
> So we can get the callback through a single 'select * from {menu_tree} 
> where path in (/* generated list of possible options */) order by 
> likelihood, slashes, wildcards';
> so you get 1 single sql query that can get the result, instead of 
> unserialising the massive tree.

Is the number of items in "generated list of possible options" -- that is, the 
SQL IN LIST small?  Is "path" an indexed column?  Doing select statements with 
IN lists is often quite inefficient.

Is the expected result set a single item, a few items or a lot of items?  (The 
answer is probably evident from an understanding of just exactly how this menu 
scheme works, but I admit I have not quite grasped it completely yet.)

Unserializing a massive tree is certainly slow.  Let's be sure we don't shoot 
ourselves in the foot with an algorithm which may be subject to SQL end-cases 
that take forever to retrieve.  :-)

If this makes a big improvement in performance as apparently it is believed to 
make possible, then it will be one of the best improvements to core.

More information about the development mailing list