"Back"

SQL Explain

{{{Executed SQL}}{{Executed SQL}}{{Executed SQL}}{{Mage_Core}}}
SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e` INNER JOIN `report_viewed_product_index` AS `idx_table` ON (idx_table.product_id=e.entity_id) AND (idx_table.visitor_id = '2785665') 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.category_id = '2' LEFT JOIN `core_store` AS `store_index` ON store_index.store_id = idx_table.store_id LEFT JOIN `core_store_group` AS `store_group_index` ON store_index.group_id = store_group_index.group_id LEFT JOIN `catalog_category_product_index` AS `store_cat_index` ON store_cat_index.product_id = e.entity_id AND store_cat_index.store_id = idx_table.store_id AND store_cat_index.category_id=store_group_index.root_category_id WHERE (cat_index.visibility IN(3, 2, 4) OR store_cat_index.visibility IN(3, 2, 4))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE idx_table ref UNQ_REPORT_VIEWED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID,IDX_REPORT_VIEWED_PRODUCT_INDEX_PRODUCT_ID UNQ_REPORT_VIEWED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID 5 const 1
1 SIMPLE store_index eq_ref PRIMARY PRIMARY 2 lalacurio_magn.idx_table.store_id 1
1 SIMPLE store_group_index eq_ref PRIMARY PRIMARY 2 lalacurio_magn.store_index.group_id 1
1 SIMPLE cat_index eq_ref PRIMARY,IDX_CAT_CTGR_PRD_IDX_PRD_ID_STORE_ID_CTGR_ID_VISIBILITY,15D3C269665C74C2219037D534F4B0DC PRIMARY 10 const,lalacurio_magn.idx_table.product_id,const 1
1 SIMPLE e eq_ref PRIMARY PRIMARY 4 lalacurio_magn.idx_table.product_id 1 Using index
1 SIMPLE store_cat_index eq_ref PRIMARY,IDX_CAT_CTGR_PRD_IDX_PRD_ID_STORE_ID_CTGR_ID_VISIBILITY,15D3C269665C74C2219037D534F4B0DC PRIMARY 10 lalacurio_magn.store_group_index.root_category_id,lalacurio_magn.idx_table.product_id,lalacurio_magn.idx_table.store_id 1 Using where