Slow Catalog Page Loads
If your catalog is very slow, it may be that the options ID isn't indexed properly, so the left join is showing way too many records. This has been changed in 2.7, so you will not need the following fix. To correct this in versions 2.55 or 2.62, open the openinfo.php page in the /enc/ folder, and:
Version 2.55
-
Change the lines:
$searchquery = "SELECT * FROM " .$DB_Prefix ."_items LEFT JOIN " .$DB_Prefix ."_options"; $searchquery .= " ON " .$DB_Prefix ."_items.ID=ItemID WHERE " .$DB_Prefix ."_items.Active = 'Yes'";
to:
$searchquery = "SELECT * FROM " .$DB_Prefix ."_items WHERE " .$DB_Prefix ."_items.Active = 'Yes'";
-
Change the line:
$searchquery .= " AND (Item LIKE '%$keyword%' OR Keywords LIKE '%$keyword%' OR Attributes LIKE '%$keyword%')";
to:
$searchquery .= " AND (Item LIKE '%$keyword%' OR Keywords LIKE '%$keyword%')";
-
Change the line:
$searchquery .= "(Item LIKE '%$addlterm%' OR Keywords LIKE '%$addlterm%' OR Attributes LIKE '%$addlterm%')";
to:
$searchquery .= "(Item LIKE '%$addlterm%' OR Keywords LIKE '%$addlterm%')";
Version 2.62
-
Remove the lines:
if (!empty($_REQUEST['keyword'])) $searchquery .= "LEFT JOIN " .$DB_Prefix ."_options ON " .$DB_Prefix ."_items.ID=ItemID ";
-
Change the line:
$searchquery .= " AND (Item LIKE '%$keyword%' OR Keywords LIKE '%$keyword%' OR Attributes LIKE '%$keyword%')";
to:
$searchquery .= " AND (Item LIKE '%$keyword%' OR Keywords LIKE '%$keyword%')";
-
Change the line:
$searchquery .= "(Item LIKE '%$addlterm%' OR Keywords LIKE '%$addlterm%' OR Attributes LIKE '%$addlterm%')";
to:
$searchquery .= "(Item LIKE '%$addlterm%' OR Keywords LIKE '%$addlterm%')";
and then save the page to the site. Please note that this will affect keyword searches - the system will no longer search for keywords within the option attributes. However, you can add those option attributes to the item keyword field if you wish.