You are here:  » Product Page - Query Speed


Product Page - Query Speed

Submitted by clare on Tue, 2011-06-21 10:26 in

When I click on a product page link (eg /product/green-linen-dress.html) for many products it takes along time to show the product page.

You recently helped much speed up the search on my site and that has made a big improvement to general searches, I am wondering if there is anything I can do about the product pages. In Google sitemaps, some pages are being rejected with the response time being too long.

I am surprised that the specific product query takes so long, as I thought it would be a quicker query than the general search..but maybe not. I think that it is products that have very long names that are the problem. Is the script searching for the words, same as general search?

site is accessible now if you wanted to check. Do you think this is just the result of the number of products in the database (nearly 2 million in .co.uk) or is it possible that during my set up I have done something to cause this problem?

I am doing some reading around about mysql optimisation as I am thinking that 2 million records is not that large a database in the scheme of things and that there must be some way I can speed things up, but as I do not have much experience of DB I am not so sure whether it is a hardware issue, although I have a dual core, with 4GB Ram available, so would think that was ok, but maybe i should consider increasing RAM on the server?

Submitted by support on Tue, 2011-06-21 11:08

Hi Clare,

It's almost certainly related products query that is slowing the page down with that size of database. Could you test that by temporarily disabling related products by changing line 10 of config.php to:

  $config_useRelated = FALSE;

If that makes a difference - if you could email me your products.php i'll make a change to the related algo (same category only rather than performing a full keyword search) for you to try...

Cheers,
David.
--
PriceTapestry.com

Submitted by clare on Tue, 2011-06-21 13:25

Yes it makes a big difference setting related to false. I have emailed to you products.php.

Same category related would be good actually, so if it improves the product page speed as well that will be an added bonus!

Thanks

Submitted by sirmanu on Fri, 2016-11-18 22:54

Is it possible to disable $config_useRelated just for search engines like google bot?

Submitted by support on Sat, 2016-11-19 08:40

Sure - in products.php look for the following code at line 82:

    if ($config_useRelated || (!isset($product)))

...and REPLACE with:

    if (preg_match("/(bot|spider|index)/i",$_SERVER["HTTP_USER_AGENT"])) $config_useRelated = FALSE;
    if ($config_useRelated || (!isset($product)))

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by sirmanu on Sat, 2016-11-19 11:47

Excellent! I will try it!