Re: Nested Sets vs. Nested Intervals
Date: 15 Nov 2005 16:50:34 -0800
Message-ID: <1132102234.954134.192860_at_g14g2000cwa.googlegroups.com>
If I use an ID in the URL instead of an array of folders, it would turn
out very inefficient because it has to use multiple joins to find the
path. However, when I use an array of folders in the URL, the path is
already in the URL, so I don't have to find the path again. That method
is very efficient.
Counting all of the listings recursively in a subcat is anyway very
inefficient for all of the methods so I would indeed use an adjacency
set.How would I count all of the listings recursively in a subcat
efficently? Should I store the number of listings below every cat so I
don't have to recursively use the count function? When I was in the
'Arts' category on dmoz.org, and I refreshed that category a couple of
times, on every page load, it showed the numbers of listings
differently every time in some subcats in the 'Arts' category. Do I
have to add a row that stores how many listings are in each category,
or are there any other efficient ways to do this? Because when every
time I insert a new listing (web page listing, not a node in a tree) in
a category, all of the ancestors listings_count row have to be updated.
That would be inefficient because the higher the category, the more
often listings_count row have to be updated, and it would slow down the
directory sufficiently because the hard disk have to rotate to the
category_count row frequently so it would slow down other stuff (like
selecting categories) considerably. How does dmoz.org do it?
Anyway, I was very "stupid" to not think that getting an ID out of an array of folders in the URL is very inefficient. Received on Wed Nov 16 2005 - 01:50:34 CET
