It is common knowledge that displaying the numbers of products in the categories box (Configuration -> My Store -> Show Category Counts = true) generates a large numbers of queries. It appears that when you use version 2 "Hide Products from customers groups for SPPC" http://www.oscommerce.com/community/contributions,3059 and the table categories is added to the count query things get starting slow when you have a decent sized shop. This optimization contribution grew from looking into that. Instead of doing a query for each category for the numbers of products and then further for evaluating if a category has subcategories, has a parent category etc. This information is queried in two queries (total) from the database and then PHP can be used to get the same results without further queries (which are slower than PHP in general). The same problem is found in the admin. The page categories.php becomes very slow if you have a lot of categories due to the large amount of queries. This small contribution slashes the numbers of queries on the front page of the default installation of osCommerce from 92 to 52 (so about two per category). On index.php?cPath=3 the number of queries goes down, on average, from 127 to 56.