On Wednesday 30 June 2004 00:35, Timwi wrote:
Nikola Smolenski wrote:
I have made a patch which enables display of all articles that belong to multiple categories.
I think the following patch is slightly more efficient.
I don't think that checking inside a loop is generally more efficient than a single call to preg_replace; however, it could be for smaller number of iterations which is the most likely case. It really should be checked.
The database query itself is very inefficient though. If this was Perl, I could make it way more efficient. In short, the "DISTINCT" and "ORDER BY" are performance killers. They should be done in PHP instead.
These take place after WHERE is executed and should have no effect on database performance other than that which already exists for selecting of a single category.