Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A Store Speed Optimization in Progress


Guest

Recommended Posts

Upon further examination, it appears that this is coming from catalog/includes/functions/general.php

////
// Return true if the category has subcategories
// TABLES: categories
 function tep_has_category_subcategories($category_id) {
   $child_category_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$category_id . "'");
   $child_category = tep_db_fetch_array($child_category_query);

   if ($child_category['count'] > 0) {
     return true;
   } else {
     return false;
   }
 }

specifically this line

$child_category_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$category_id . "'");

It changes, depending on the page selected, to reflect all of the categories and sub-categories that are displayed in the standard osC categories box (in column_left). How can I eliminate these queries (since I don't care to display category counts) without affecting the display of the categories box?

... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Link to comment
Share on other sites

  • 1 month later...
  • Replies 905
  • Created
  • Last Reply

For those who don't want to cache the entire page, here are a few code snippets to cache some boxes that don't change often. This code has been copypasted from the standard osC cacheing code for the categories box.

 

First, two functions to add to includes/functions/cache.php:

 

//! Cache the new_products box
// Cache the new_products box
 function tep_cache_new_products_box($auto_expire = false, $refresh = false) {
   global $cPath, $language, $languages_id, $tree, $cPath_array, $new_products_string, $currencies;
   if (($refresh == true) || !read_cache($cache_output, 'new_products_box-' . $language . '.cache' . $cPath, $auto_expire)) {
     ob_start();
     include(DIR_WS_MODULES . 'new_products.php');
     $cache_output = ob_get_contents();
     ob_end_clean();
     write_cache($cache_output, 'new_products_box-' . $language . '.cache' . $cPath);
   }

   return $cache_output;
 }

//! Cache the upcoming products
// Cache the upcoming products
 function tep_cache_upcoming_products_box($auto_expire = false, $refresh = false) {
   global $language, $languages_id, $upcoming_products_string;
   if (($refresh == true) || !read_cache($cache_output, 'upcoming_products_box-' . $language . '.cache', $auto_expire)) {
     ob_start();
     include(DIR_WS_MODULES . 'upcoming_products.php');
     $cache_output = ob_get_contents();
     ob_end_clean();
     write_cache($cache_output, 'upcoming_products_box-' . $language . '.cache');
   }

   return $cache_output;
 }

 

This code will cache the upcoming products (only one file since it's only shown on the main page) and the new products (once for each cPath, just like the categories). To call these functions properly, use this code in index.php:

 

find:

    include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

 

replace with:

if ((USE_CACHE == 'true') && empty($SID)) {
   echo tep_cache_upcoming_products_box();
 } else {
   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
 }

 

also find two instances of:

include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);

[code]

and replace with:

[code]

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_new_products_box();

} else {

include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);

}

[code]

 

Just like the categories box, you can refresh your cache by deleting the contents of the cache directory (as defined in the osCommerce admin screen). I'm sure someone could write a cronjob that would do that on a daily basis or somesuch, but it's not that big of a deal to me.

 

By following most of Chemo's advice in this thread and using the osCommerce cache functions, I have my main page query count down to 15 without cacheing the entire page - I want the rest of the boxes to remain dynamic.

Chris Dunning

osCommerce, Contributions Moderator Team

 

Please do not send me PM! I do not read or answer these often. Use the email button instead!

 

I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly.

Link to comment
Share on other sites

Very nice post...

 

Remember, the stock osC cache code ONLY works for those customers that have cookies turned on!

 

Bobby

Link to comment
Share on other sites

I don't get it, how are you guys reducing the queries by so much? How do you "JOIN" so it only queries once for each? Can somone give us some examples, this thing is killing my mysql server as is :(

 

Cheers

Link to comment
Share on other sites

Vince,

 

Optimizing a site is not a cookie cutter procedure. Each store has different contributions installed, number of categories, number of products, number of orders, and number of customers. How you optimize will be determined by the above factors.

 

Bobby

Link to comment
Share on other sites

Hi Bobby thanks for the reply. From what I can tell the bulk of my queries are from product categories and product listing. It looks as though on every page this thing queries every category individually. If you take a look here http://www.4jewelrystore.com/ you can see.

 

I swapped back to the normal product listing but only saved me around 25 queries on the product listing pages. If I can just somehow join this one which obviously pulls categories up i'd instantly save 50 or so queries per page.

 

select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd where c.categories_id = cd.categories_id and cd.language_id = '1' and c.parent_id = '313' order by c.sort_order, cd.categories_name

 

I don't understand why that is being queried even on the login page? My main menu is static aswell as that search so it's not those. Is application top grabbing them?

 

Thanks again

 

 

 

 

Vince,

 

Optimizing a site is not a cookie cutter procedure.  Each store has different contributions installed, number of categories, number of products, number of orders, and number of customers.  How you optimize will be determined by the above factors.

 

Bobby

Link to comment
Share on other sites

Look at whatever contributions you have installed and is being called directly after the visitor tracking code. Here is the query to look for:

select visitors_id, products_id from recently_viewed where visitors_id = '58539' order by time DESC limit 10

Whatever contribution comes after that needs to be looked at a little closer...

 

Bobby

Link to comment
Share on other sites

Look at whatever contributions you have installed and is being called directly after the visitor tracking code.  Here is the query to look for:

select visitors_id, products_id from recently_viewed where visitors_id = '58539' order by time DESC limit 10

Whatever contribution comes after that needs to be looked at a little closer...

 

Bobby

 

Where would I look to find out which one comes after recentlyviewed? I don't think I got that recently viewed to work, not sure why I left it in there..

 

Cheers

Link to comment
Share on other sites

Where would I look to find out which one comes after recentlyviewed?  I don't think I got that recently viewed to work, not sure why I left it in there..

 

Cheers

 

 

I think it's got something to do with this code but this is in index.php not sure why it's being called on all the other pages aswell..

 

        // DWD Contribution -> Remove: Browse by Categories v2.2.
   //     if (isset($cPath) && strpos('_', $cPath)) {
   // // check to see if there are deeper categories within the current category
   //       $category_links = array_reverse($cPath_array);
   //       for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
   //         $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
   //         $categories = tep_db_fetch_array($categories_query);
   //         if ($categories['total'] < 1) {
   //           // do nothing, go through the loop
   //         } else {
   //           $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
   //           break; // we've found the deepest category the customer is in
   //         }
   //       }
   //     } else {
   //       $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

Link to comment
Share on other sites

I think it's got something to do with this code but this is in index.php not sure why it's being called on all the other pages aswell..

 

LOL Actually without word wrap I find that code is commented out! Damn now I am completly lost :(

 

 

-------------------

Nope I removed the include to that file on index.php and those queries are still there lol So that's not it :'(

Link to comment
Share on other sites

LOL Actually without word wrap I find that code is commented out! Damn now I am completly lost :(

-------------------

Nope I removed the include to that file on index.php and those queries are still there lol So that's not it  :'(

 

Got it!!! I deleted this code and it dropped my main page to 39 queries:

In sts_user_code

    $sts_block_name = 'catmenu';
   require(STS_START_CAPTURE);
   echo "\n<!-- Start Category Menu -->\n";
   echo tep_draw_form('goto', FILENAME_DEFAULT, 'get', '');
   echo tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
   echo "</form>\n";
   echo "<!-- End Category Menu -->\n";
   require(STS_STOP_CAPTURE);
   $template['catmenu'] = $sts_block['catmenu'];

 

Still 195 queries on product listing pages though and this fix won't be as simple :(

Link to comment
Share on other sites

Hi everybody! Hi Chemo! :D

 

I've read the thread and everything is not very clear for me as I'm not skilled enough. But I found it very interesting. I do have a problem with my advanced_search_result.php page as it takes too many time to display the results. (I've installed products extra fields contribution but even if i remove it => same pb).

 

I've just installed the debug contribution and found that my site was damned too slow!!!! I've changed the queries and put the "left join" etc and it's now better but I have a huge group of queries 240 to 290 on my index.php page. It seems some queries are duplicated but I'm really unable to appreciate if this is true and if there is something to do! :(

 

Could someone have a look to the code debug and tell me if you could give me some advices. Do you think I can improve my site?

 

I'm still working on the products_queries (specials, new_products etc) but the site remains slow.

 

Current Parse Time: 6.164 s with 219 queries

 

Array

(

   [QUERIES] => Array

       (

           [0] => select configuration_key as cfgKey, configuration_value as cfgValue from configuration

           [1] => select value from sessions where sesskey = 'fca35f96d0104ed5444ec54077b1b00f' and expiry > '1110252491'

           [2] => select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from currencies

           [3] => DELETE FROM cache WHERE cache_expires <= '2005-03-08 04:28:11'

           [4] => SELECT cache_expires FROM cache WHERE cache_id='9e18319fdade9c4245b75b9845486bb8' AND cache_language_id='1' LIMIT 1

           [5] => SELECT cache_expires FROM cache WHERE cache_id='dae46d252d93631f218b79dd62eb04eb' AND cache_language_id='1' LIMIT 1

           [6] => SELECT cache_expires FROM cache WHERE cache_id='f47315cba5e35ca49994fbf925cfaa75' AND cache_language_id='1' LIMIT 1

           [7] => SELECT cache_id, cache_language_id, cache_name, cache_data, cache_global, cache_gzip, cache_method, cache_date, cache_expires FROM cache WHERE cache_language_id='1' AND cache_global='1'

           [8] => delete from whos_online where time_last_click < '1110251591'

           [9] => select count(*) as count from whos_online where session_id = 'fca35f96d0104ed5444ec54077b1b00f'

           [10] => update whos_online set customer_id = '0', full_name = 'Guest', ip_address = '192.168.0.4', time_last_click = '1110252491', last_page_url = '/store/index.php?output=1' where session_id = 'fca35f96d0104ed5444ec54077b1b00f'

           [11] => select specials_id from specials where status = '1' and now() >= expires_date and expires_date > 0

           [12] => select featured_id from featured where status = '1' and now() >= expires_date and expires_date > 0

           [13] => select zoom1_id from zoom1 where status = '1' and now() >= expires_date and expires_date > 0

           [14] => select zoom2_id from zoom2 where status = '1' and now() >= expires_date and expires_date > 0

           [15] => select cadeaux_id from cadeaux where status = '1' and now() >= expires_date and expires_date > 0

           [16] => select configuration_key as cfgKey, configuration_value as cfgValue from phesis_poll_config

           [17] => select configuration_key as cfgKey, configuration_value as cfgValue from phesis_poll_config

           [18] => select categories_description from categories_description where categories_id = '0' and language_id = '1'

           [19] => select categories_type from categories where categories_id = '0'

           [20] => select cd.categories_name, c.category_head_title_tag, c.category_head_desc_tag, c.category_head_keywords_tag from categories c, categories_description cd where c.categories_id = '0' and cd.categories_id = '0' and cd.language_id = '1'

           [21] => select manufacturers_name from manufacturers where manufacturers_id = '0'

           [22] => select languages_id, name, code, image, directory from languages order by sort_order

           [23] => select count(*) as total  from products p, products_description pd, specials s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and s.status = '1'

           [24] => select p.products_id, pd.products_name, p.products_price,p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and s.status = '1' order by s.specials_date_added DESC limit 0, 10

           [25] => select c.categories_id,

                                              cd.categories_name,

                                              c.parent_id

                                       from categories c,

                                            categories_description cd

                                       where c.parent_id = '0' and

                                             c.categories_id = cd.categories_id and

                                             cd.language_id='1'

             and sort_order >0

                                       order by sort_order, cd.categories_name

           [26] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [27] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '86' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [28] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '81' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [29] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '82' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [30] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '74' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [31] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '80' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [32] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '103' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [33] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '29' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [34] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '50' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [35] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '55' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [36] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '56' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [37] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '63' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [38] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '87' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [39] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '2' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [40] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '59' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [41] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '19' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [42] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '23' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [43] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '60' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [44] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '24' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [45] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '44' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [46] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '26' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [47] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '27' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [48] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '85' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [49] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '102' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [50] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '1' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [51] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '8' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [52] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '22' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [53] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '65' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [54] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '101' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [55] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '68' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [56] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '66' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [57] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '64' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [58] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '78' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [59] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '69' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [60] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '33' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [61] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '70' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [62] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '43' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [63] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '75' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [64] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '76' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [65] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '77' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [66] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '58' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [67] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '72' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [68] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '83' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [69] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '98' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [70] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '67' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [71] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '100' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [72] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '35' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [73] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '36' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [74] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '41' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [75] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '62' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [76] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '84' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [77] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '79' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [78] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '88' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [79] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '95' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [80] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '96' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [81] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '97' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [82] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '94' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [83] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '89' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [84] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '91' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [85] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '90' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [86] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '92' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [87] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '93' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [88] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '25' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [89] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '39' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [90] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '37' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [91] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '38' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [92] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '40' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [93] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '21' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [94] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '71' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [95] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '73' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [96] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '31' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [97] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '3' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [98] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '10' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [99] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '13' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [100] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '12' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [101] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '15' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [102] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '11' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [103] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '14' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [104] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '32' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [105] => select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '61' and c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

           [106] => select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd where c.categories_status = '1' and c.sort_order > '0' and c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='1' order by sort_order, cd.categories_name

           [107] => select count(*) as count from categories where parent_id = '44'

           [108] => select count(*) as count from categories where parent_id = '44'

           [109] => select count(*) as count from categories where parent_id = '85'

           [110] => select count(*) as count from categories where parent_id = '85'

           [111] => select count(*) as count from categories where parent_id = '102'

           [112] => select count(*) as count from categories where parent_id = '102'

           [113] => select count(*) as count from categories where parent_id = '1'

           [114] => select count(*) as count from categories where parent_id = '1'

           [115] => select count(*) as count from categories where parent_id = '67'

           [116] => select count(*) as count from categories where parent_id = '67'

           [117] => select count(*) as count from categories where parent_id = '88'

           [118] => select count(*) as count from categories where parent_id = '88'

           [119] => select count(*) as count from categories where parent_id = '89'

           [120] => select count(*) as count from categories where parent_id = '89'

           [121] => select count(*) as count from categories where parent_id = '25'

           [122] => select count(*) as count from categories where parent_id = '25'

           [123] => select count(*) as count from categories where parent_id = '21'

           [124] => select count(*) as count from categories where parent_id = '21'

           [125] => select count(*) as count from categories where parent_id = '61'

           [126] => select count(*) as count from categories where parent_id = '61'

           [127] => select configuration_column as cfgcol, configuration_title as cfgtitle, configuration_value as cfgvalue, configuration_key as cfgkey, box_heading from theme_configuration order by location

           [128] => select DISTINCT p.manufacturers_id, m.manufacturers_name from manufacturers m left join products p on m.manufacturers_id = p.manufacturers_id left join products_to_categories p2c on p.products_id = p2c.products_id left join categories c on p2c.categories_id = c.categories_id where c.categories_status = '1' and p.products_status = '1' order by m.manufacturers_name

           [129] => select DISTINCT p.manufacturers_id, m.manufacturers_name from manufacturers m, products p where p.manufacturers_id = m.manufacturers_id and p.products_status = '1' order by manufacturers_name

           [130] => select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p left join  specials s on p.products_id = s.products_id left join products_description pd on pd.products_id = s.products_id left join products_to_categories p2c on p.products_id = p2c.products_id left join categories c on p2c.categories_id = c.categories_id where c.categories_status='1' and p.products_status = '1' and pd.language_id = '1' and s.status = '1' and s.customers_group_id = '0' order by s.specials_date_added desc

           [131] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [132] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [133] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [134] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [135] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [136] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [137] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '3' group by tr.tax_priority

           [138] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '3' group by tr.tax_priority

           [139] => select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name from products p left join products_description pd on p.products_id = pd.products_id where products_status = '1' order by products_date_added desc limit 100

           [140] => select specials_new_products_price from specials where products_id = '1655' and status and customers_group_id = '0'

           [141] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [142] => select * from news_infos ORDER BY id DESC LIMIT 0, 5

           [143] => select categories_name from categories_description where categories_id = '' limit 1

           [144] => select p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price, pd.products_name from categories c, products_to_categories p2c, products p left join products_description pd on p.products_id = pd.products_id left join cadeaux f on p.products_id = f.products_id where c.categories_status='1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_status = '1' and f.status = '1' and pd.language_id = '1' order by rand(4401) DESC limit 2

           [145] => select products_id, specials_new_products_price from specials where (products_id = '25' or products_id = '63' ) and status = '1' and customers_group_id = '0'

           [146] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [147] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [148] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [149] => select count(*) as count from configuration

           [150] => select categories_name from categories_description where categories_id = '' limit 1

           [151] => select substring(pd.products_description, 1, 300) as products_description, pd.products_name, pd.products_subtitle, p.products_id, p.products_image, p.manufacturers_id, p.products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_tax_class_id, sp.product_id from products p, products_description pd, star_product sp left join specials s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_status = '1' and pd.products_description != '' and p.products_id=sp.product_id and pd.language_id = '1'

           [152] => select products_id, specials_new_products_price from specials where (25) and status = '1' and customers_group_id = '0'

           [153] => select p.products_id, pefv.pef_value from products p left join products_description pd on pd.products_id = p.products_id left join t_products_to_products_extra_fields ptpef on ptpef.fk_products_id = p.products_id left join t_products_extra_fields_value pefv on ptpef.pk_ptpef_id = pefv.fk_ptpef_id where ptpef.fk_pef_id = '1' and p.products_id = '25' and pefv.language_id = pd.language_id and pd.language_id = '1'

           [154] => select products_name from products_description where products_id = '25' and language_id = '1'

           [155] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [156] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [157] => select categories_name from categories_description where categories_id = '' limit 1

           [158] => select m.manufacturers_name, substring(pd.products_description, 1, 200) as products_description, pd.products_name, pd.products_subtitle, p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from  manufacturers m, categories c, products_to_categories p2c, products_description pd left join products p on p.products_id = pd.products_id left join zoom1 f on p.products_id = f.products_id where p.manufacturers_id = m.manufacturers_id and c.categories_status='1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_status = '1' and f.status = '1' and pd.language_id = '1' order by rand(15684) DESC limit 10

           [159] => select products_id, specials_new_products_price from specials where (products_id = '25' ) and status = '1' and customers_group_id = '0'

           [160] => select p.products_id, pefv.pef_value from products p left join products_description pd on pd.products_id = p.products_id left join t_products_to_products_extra_fields ptpef on ptpef.fk_products_id = p.products_id left join t_products_extra_fields_value pefv on ptpef.pk_ptpef_id = pefv.fk_ptpef_id where ptpef.fk_pef_id = '1' and p.products_id = '25' and pefv.language_id = pd.language_id and pd.language_id = '1'

           [161] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [162] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [163] => select categories_name from categories_description where categories_id = '' limit 1

           [164] => select m.manufacturers_name, substring(pd.products_description, 1, 200) as products_description, pd.products_name, pd.products_subtitle, p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from  manufacturers m, categories c, products_to_categories p2c, products_description pd left join products p on p.products_id = pd.products_id left join zoom2 f on p.products_id = f.products_id where p.manufacturers_id = m.manufacturers_id and c.categories_status='1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_status = '1' and f.status = '1' and pd.language_id = '1' order by rand(23209) DESC limit 6

           [165] => select products_id, specials_new_products_price from specials where (products_id = '25' ) and status = '1' and customers_group_id = '0'

           [166] => select p.products_id, pefv.pef_value from products p left join products_description pd on pd.products_id = p.products_id left join t_products_to_products_extra_fields ptpef on ptpef.fk_products_id = p.products_id left join t_products_extra_fields_value pefv on ptpef.pk_ptpef_id = pefv.fk_ptpef_id where ptpef.fk_pef_id = '1' and p.products_id = '25' and pefv.language_id = pd.language_id and pd.language_id = '1'

           [167] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [168] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [169] => select p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price, pd.products_name from  products p left join products_description pd on p.products_id = pd.products_id left join products_to_categories p2c on p.products_id = p2c.products_id left join categories c on p2c.categories_id = c.categories_id where c.categories_status='1' and products_status = '1' and to_days(products_last_modified) >= (to_days(now())-15) order by rand() desc limit 6

           [170] => select products_id, specials_new_products_price from specials where (products_id = '25' or products_id = '63' or products_id = '25' or products_id = '25' or products_id = '1342' or products_id = '520' or products_id = '1628' or products_id = '1684' or products_id = '1147' or products_id = '1159' ) and status = '1' and customers_group_id = '0'

           [171] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [172] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [173] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [174] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [175] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [176] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [177] => select categories_name from categories_description where categories_id = '' limit 1

           [178] => select p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price, pd.products_name from categories c, products_to_categories p2c, products p left join products_description pd on p.products_id = pd.products_id left join featured f on p.products_id = f.products_id where c.categories_status='1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_status = '1' and f.status = '1' and pd.language_id = '1' order by rand(5585) DESC limit 6

           [179] => select products_id, specials_new_products_price from specials where (products_id = '25' or products_id = '63' or products_id = '25' or products_id = '25' or products_id = '1342' or products_id = '520' or products_id = '1628' or products_id = '1684' or products_id = '1147' or products_id = '1159' or products_id = '732' or products_id = '1551' or products_id = '529' or products_id = '25' or products_id = '153' ) and status = '1' and customers_group_id = '0'

           [180] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [181] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [182] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [183] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [184] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [185] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [186] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '73') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '667') and tr.tax_class_id = '2' group by tr.tax_priority

           [187] => select distinct c.parent_id, c.categories_image, c.categories_id, cd.categories_name, p.products_id, pd.products_name from products p left join products_description pd on p.products_id = pd.products_id left join products_to_categories p2c on p.products_id = p2c.products_id left join categories c on c.categories_id = p2c.categories_id left join categories_description cd on c.categories_id = cd.categories_id where p.products_status = '1' and c.categories_status = '1' and p.products_ordered > 0 and pd.language_id = cd.language_id and pd.language_id = '1' order by p.products_ordered desc, pd.products_name limit 100

           [188] => select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from products p left join products_description pd on p.products_id = pd.products_id left join reviews r on p.products_id = r.products_id where p.products_status = '1' and r.approved='1' and pd.language_id = '1' order by r.reviews_id desc limit 1000

           [189] => select round(avg(reviews_rating),0) as mean, count(*) as rcount from reviews where approved='1' and products_id = '761'

           [190] => select substring(reviews_text, 1, 60) as reviews_text from reviews_description where reviews_id = '21' and languages_id = '1'

           [191] => select configuration_column as cfgcol, configuration_title as cfgtitle, configuration_value as cfgvalue, configuration_key as cfgkey, box_heading from theme_configuration order by location

           [192] => select * from customers_wishlist WHERE customers

Link to comment
Share on other sites

For future reference, don't post 192 queries. It makes it a chore to look throught them all. Just post the repetitive ones.

 

If the optimize tep_get_tax() contribution is installed it is not functioning correctly. If it were you would have eliminated about 33% of those queries. It appears as though you have some contribution calling every category getting the name and description. Cache that data.

 

Bobby

Link to comment
Share on other sites

Great thanks for you, Bobby, Jared and Dennis. I do appreciate your answers. :)

 

For future reference, don't post 192 queries.  It makes it a chore to look throught them all.  Just post the repetitive ones.

 

Sorry!! :blush:

 

If the optimize tep_get_tax() contribution is installed it is not functioning correctly.

 

I've followed the instructions for the install and met no pb. How to have it functioning in a right way.

 

If it were you would have eliminated about 33% of those queries.  It appears as though you have some contribution calling every category getting the name and description.  Cache that data.

Sorry I'm a bit lost ...but I do want to understand and I'm ready to work hard on it. Could you help me more on this problem? I've put on the index.php page a best sellers box which diplays the name of the category plus the name of the product. Maybe it's why there are so many categories queries? What do you think?

 

 

192... good lord!

 

I'm not proud at all!!! hope I'll be able to improve my site!!

 

Did you turn off category count?

 

No... how to turn it off? I didn't find it in this thread?!

Link to comment
Share on other sites

Did you turn off category count?

 

You mean the category count in the categories box? If so I've already turned it off.

Moreover, my categories box is not the original one. It displays only the subcategories of the current parent category. I thought it leads to less queries????

Link to comment
Share on other sites

Bobby,

 

I've found out why the optimize tep_get_tax() contribution wasn't working in a right way no more. I've installed a week ago the new version of the contribution called Separate price per customer.

 

THe instal ask to modify the function tep_get_tax_rate. Here's my code. How to have your contribution work with this B2B (SPPC) contribution?

 

  function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
  // BOF Separate Pricing Per Customer, tax exempt modification
   global $customer_zone_id, $customer_country_id, $sppc_customer_group_tax_exempt;

    if(!tep_session_is_registered('sppc_customer_group_tax_exempt')) {
    $customer_group_tax_exempt = '0';
    } else {
    $customer_group_tax_exempt = $sppc_customer_group_tax_exempt;
    }

    if ($customer_group_tax_exempt == '1') {
     return 0;
    }
// EOF Separate Pricing Per Customer, tax exempt modification

   if ( ($country_id == -1) && ($zone_id == -1) ) {
     if (!tep_session_is_registered('customer_id')) {
       $country_id = STORE_COUNTRY;
       $zone_id = STORE_ZONE;
     } else {
       $country_id = $customer_country_id;
       $zone_id = $customer_zone_id;
     }
   }

   $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' group by tr.tax_priority");
   if (tep_db_num_rows($tax_query)) {
     $tax_multiplier = 1.0;
     while ($tax = tep_db_fetch_array($tax_query)) {
       $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100);
     }
     return ($tax_multiplier - 1.0) * 100;
   } else {
     return 0;
   }
 }

Link to comment
Share on other sites

I found that the number of categories queries come in part from the search box in the header. I'm still working on it to decrease the queries number.

 

Bobby,

 

I know you're very busy but may I ask for your help please. I saw you did a lot of good job and I've installed a lot of your contributions that work perfectly. You said that if you were I, you would have eliminated about 33% of the queries. I'm really a newbie but I willingly love to learn. Could you please explain me how to improve the loading of my pages. Hard works don't fear me, I just need help to know how to start.

 

BTW, I don't want to use page cache contribution for security reasons.

 

Thanks a lot!

Link to comment
Share on other sites

            [15] => select count(*) as count from categories where parent_id = '27'
           [16] => select count(*) as count from categories where parent_id = '27'
           [17] => select count(*) as count from categories where parent_id = '54'
           [18] => select count(*) as count from categories where parent_id = '54'
           [19] => select count(*) as count from categories where parent_id = '66'
           [20] => select count(*) as count from categories where parent_id = '66'
           [21] => select count(*) as count from categories where parent_id = '76'
           [22] => select count(*) as count from categories where parent_id = '76'

 

Above is a portion of db queries. I was wondering if this is normal to have 2 of the same queries. this is just a bit of it.. i have total of about 100 of this type. if i can eliminate half, thats already 50. now, i do not know.. and could not tell were these queries are from or which script does it. so please...... help me out. :huh:

Link to comment
Share on other sites

BTW, I don't want to use page cache contribution for security reasons.

 

Just what security reasons are you referring to here? As far as I know, the page cache contribution only caches the pages you specify - eg index.php, product_info.php, and has no security risks whatsoever.

 

You can't just make a statement like that without validating it, since you may make other people unduly concerned.

Link to comment
Share on other sites

Just what security reasons are you referring to here? As far as I know, the page cache contribution only caches the pages you specify - eg index.php, product_info.php, and has no security risks whatsoever.

 

You can't just make a statement like that without validating it, since you may make other people unduly concerned.

 

My english is not fluent so I have some vocabulary lacks to give you an accurate explanation. I read the whole thread and many others and decided not to install page cache as my skills are really limited and as some people spoke about security weakness I'm not able to manage. For instance go page 2 of this thread. Hope my post were not that misleading. :blush:

Link to comment
Share on other sites

I think the security problem was with the original version, which cached pages with the session ID in the url - somebody else could then come along and view a "cached version" of that page with the session ID in the URL - this would cause all sorts of problems as they would in effect "inherit" that session, with potentially severe consequences (they would in effect _be_ that person as far as the app is concerned)

Chemo released a fix that stripped session IDs from URLs that are cached, so this is no longer a problem.

Of course, if your URLs contain session IDS (usually due to improper cookie domain settings), or if the user disables cookies, then this sort of thing can happen anyway - if the URL gets pasted somewhere - anyone clicking on the link whilst their session is still active will inherit their session.

This is why cookies are a good idea for security!

There's not a lot you can do about SessionIDs in URLs if the user has turned off cookies. You can only protect them by enabling "force cookie use", which stops them logging on or checking out unless they enable cookies.

But going back to the original issue of the page cache security- there's really no reason not to give it a go - there are no security risks!

Link to comment
Share on other sites

My english is not fluent so I have some vocabulary lacks to give you an accurate explanation. I read the whole thread and many others and decided not to install page cache as my skills are really limited and as some people spoke about security weakness I'm not able to manage. For instance go page 2 of this thread. Hope my post were not that misleading.  :blush:

As was said above, there were initially some issues with the osCsid. However, those issues were resolved quickly. Isn't that the nature of open source software? An initial release is posted and people install...they offer feedback until it is perfected. IMO, the page cache contribution is far from perfect however it is mature in development and is production level quality.

 

When optimizing a store it is always best to first optimize the queries being executed to keep the presentation dynamic. However, if there are contributions installed that will not allow this to happen (STS for example) then the page cache is the next best thing.

 

Bobby

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...