CREATE TEMPORARY TABLE _product_filters_products_1 (PRIMARY KEY product_id (product_id)) ENGINE = MEMORY IGNORE SELECT products.product_id FROM products AS products LEFT JOIN companies AS companies ON companies.company_id = products.company_id INNER JOIN products_categories as products_categories ON products_categories.product_id = products.product_id INNER JOIN categories ON categories.category_id = products_categories.category_id AND (categories.usergroup_ids = '' OR FIND_IN_SET(0, categories.usergroup_ids) OR FIND_IN_SET(1, categories.usergroup_ids)) AND categories.status IN ('A', 'H') AND categories.storefront_id IN (0, 1) LEFT JOIN product_options_inventory as inventory ON inventory.product_id = products.product_id LEFT JOIN product_popularity as popularity ON popularity.product_id = products.product_id WHERE 1=1 AND companies.status IN ('A') AND products.company_id = 9763 AND (products.amount > 0 OR products.tracking = 'D') AND (products.usergroup_ids = '' OR FIND_IN_SET(0, products.usergroup_ids) OR FIND_IN_SET(1, products.usergroup_ids)) AND products.status IN ('A') AND products.company_id = 9763 ORDER BY NULL