tagin Posted March 11, 2006 Share Posted March 11, 2006 Hello, I am optimizing my store and thanks to this board I went down from 1.5s-2s page load time to 0.100-0.120. I still see the following though: [18] => select categories_id from categories where parent_id = '2' [19] => select categories_id from categories where parent_id = '18' [20] => select categories_id from categories where parent_id = '19' [21] => select categories_id from categories where parent_id = '20' Since I got the get-path optimization I believe that it comes from general.php function tep_count_products_in_category Are there any optimizations for this function readily available? The OSC cache feature doesn't caches the results . thank you! Link to comment Share on other sites More sharing options...
wheeloftime Posted March 11, 2006 Share Posted March 11, 2006 Hello, I am optimizing my store and thanks to this board I went down from 1.5s-2s page load time to 0.100-0.120. I still see the following though: [18] => select categories_id from categories where parent_id = '2' [19] => select categories_id from categories where parent_id = '18' [20] => select categories_id from categories where parent_id = '19' [21] => select categories_id from categories where parent_id = '20' Since I got the get-path optimization I believe that it comes from general.php function tep_count_products_in_category Are there any optimizations for this function readily available? The OSC cache feature doesn't caches the results . thank you! In your admin->configuration set 'Show Category Counts' to false Link to comment Share on other sites More sharing options...
tagin Posted March 11, 2006 Author Share Posted March 11, 2006 In your admin->configuration set 'Show Category Counts' to false I did it already, but the queries are still there. Link to comment Share on other sites More sharing options...
RL2000 Posted August 30, 2006 Share Posted August 30, 2006 A quick optimization I did, and it seems to work is: $products_query = tep_db_query("select count(*) as total from (" . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ON p.products_id = p2c.products_id and p.products_status = '1'), " . TABLE_CATEGORIES . " c WHERE c.categories_id = p2c.categories_id and c.parent_id = '" . (int)$category_id . "'"); I know this is an old thread, but anyhow, there you have it. I have about 9 thousand products and 300 categories in my shop, so it took a while the old way :P Insert clever remark here Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.