[pLog-svn] Database layout

Oscar Renalias oscar at renalias.net
Mon May 22 14:38:17 GMT 2006


> Oscar, when you said data is loaded anyway, I am not sure what you  
> mean.
> In my panel.template, I use articleCategory->getNumArticles()
> The query to calculate the number of articles wouldn't be called if  
> I removed that, right?

Yes it would. Actually, there is no query because both in 1.1 and 1.0  
this field has already been loaded when loading the category. Just  
take a look at ArticleCategories::getBlogCategories() in boht 1.0 and  
1.1.

In 1.0 it is done with that complex-ish "IF(a.id IS NULL, 0, COUNT 
(*)) AS num_articles" bit in the ArticleCategories::getBlogCategories 
() and in 1.1 there is already a field used for counting the number  
of posts, so loading it is extremely cheap (at least when compared  
with 1.0)

Osca


More information about the pLog-svn mailing list