在前端搜索时出现Magento错误,原因是report_event


Magento Error when searching on frontend caused by report_event

我有一个magento安装程序,有两个网站连接到它(不同的URLS)。有了其中一个,我没有问题,网站加载很快,没有错误等。另一个,这是主要的一个,有了更多的产品,我有不断的错误,而且速度非常慢。

我遇到的主要问题是,我必须不断地在数据库中使用report_event表,否则当人们搜索时,我会在前端出现错误,例如:

There has been an error processing your request
SELECT COUNT(report_table_views.event_id) AS `views`, `e`.*, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position`, `e`.`name`, `e`.`sku`, `e`.`price`, `e`.`small_image`, `e`.`status`, `e`.`tax_class_id`, `e`.`url_key`, `e`.`thumbnail`, `e`.`short_description`, `e`.`special_price`, `e`.`special_from_date`, `e`.`special_to_date`, `e`.`news_from_date`, `e`.`news_to_date`, `e`.`required_options`, `e`.`price_type`, `e`.`weight_type`, `e`.`price_view`, `e`.`shipment_type`, `e`.`image_label`, `e`.`small_image_label`, `e`.`thumbnail_label`, `e`.`links_purchased_separately`, `e`.`msrp_enabled`, `e`.`msrp_display_actual_price_type`, `e`.`msrp`, `e`.`links_exist`, `e`.`man_part_code`, `e`.`our_part_no`, `e`.`donor_make_attr`, `e`.`donor_model_attr`, `e`.`donor_modeldetails_attr`, `e`.`donor_bodycolour_attr`, `e`.`donor_intcolour_attr`, `e`.`donor_engine_attr`, `e`.`condition_description`, `e`.`part_condition_description`, `e`.`part_condition_description_value`, `e`.`year`, `e`.`make`, `e`.`v_model` FROM `report_event` AS `report_table_views`
 INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = report_table_views.object_id AND e.entity_type_id = 10
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '3' WHERE (report_table_views.event_type_id = 1) AND (e.entity_id IN(267, 366, 2389, 3892, 3893, 3895, 4039, 5129, 5217, 5218, 6132, 6320, 6452, 6583, 8308, 8566, 8857, 8862, 9500, 9561, 9562, 9566, 9567, 9568, 9569, 9570, 9572, 9573, 9574, 9614, 9674, 10000)) GROUP BY `e`.`entity_id` HAVING (COUNT(report_table_views.event_id) > 0) ORDER BY `views` DESC LIMIT 5

这真的让我很沮丧,因为我似乎无法弄清楚它是什么。我试过禁用事件报告,但没有什么乐趣。我认为这也与网站的速度有关。

有人遇到过这个问题,或者知道禁止使用这个表的方法吗?

感谢

最后,我通过在local.xml文件中输入以下内容禁用了产品视图的报告。我不知道到底是什么原因导致了这个问题,但自从我添加了这个之后,它就不再发生了。

<catalog_controller_product_view>
    <observers><reports><type>disabled</type></reports></observers>
</catalog_controller_product_view>

希望这能帮助其他人。