[wp-hackers] Category Operation (Adjacency vs. Modified Preorder)

Mark Jaquith mark.wordpress at txfx.net
Sat Feb 11 06:38:23 GMT 2006


On Feb 10, 2006, at 8:33 AM, Christopher Johnson wrote:

> The method requires a little more work during inserts and updates  
> but allows for much faster and much more flexible queries. An  
> example ... with this method you could extract an entire sub tree  
> from the categories table with only 1 query and no sub-selects (2  
> joins). No recursive post processing is needed either. When  
> retrieving posts by category, multiple sub tree's could be excluded  
> or included with a single query (2 joins). The path to a category,  
> a list of siblings, a list of children, all can be retreived with  
> single query, but not at the same time of course.

It certainly sounds nice.  One thing I noticed about that article is  
that the old "parent style" can be kept, and run in tandem.  Sounds  
to me like we could update the WordPress code to use the transversal  
style, but plugins that directly query the table looking for parent  
relationships wouldn't be left in the dark.

--
Mark Jaquith
http://txfx.net/




More information about the wp-hackers mailing list