I have a search that is taking 10 seconds+ to execute! Keep in mind it is also searching over 200,000 products in the database. I posted the explain and MySQL query here.
1 SIMPLE p ref PRIMARY,products_status,prod_prodid_status,product... products_status 1 const 9048 Using where; Using temporary; Using filesort
1 SIMPLE v ref PRIMARY,vendors_id,vendors_vendorid vendors_vendorid 4 rhinomar_rhinomartnew.p.vendors_id 1
1 SIMPLE s ref products_id products_id 4 rhinomar_rhinomartnew.p.products_id 1
1 SIMPLE pd ref PRIMARY,products,prod_desc_prodid_prodname prod_desc_prodid_prodname 4 rhinomar_rhinomartnew.p.products_id 1
1 SIMPLE p2c ref PRIMARY,ptc_catidx PRIMARY 4 rhinomar_rhinomartnew.p.products_id 1 Using where; Using index
1 SIMPLE c eq_ref PRIMARY PRIMARY 4 rhinomar_rhinomartnew.p2c.categories_id 1 Using where
MySQL Query:
Select p.products_id, p.products_image, p.products_price, p.products_weight,
p.products_unit_quantity,
s.specials_new_products_price, s.status,
pd.products_name, pd.products_img_alt
From products p
Left Join vendors v On v.vendors_id = p.vendors_id
Left Join specials s On s.products_id = p.products_id
Left Join products_description pd On pd.products_id = p.products_id
Left Join products_to_categories p2c On p2c.products_id = p.products_id
Left Join categories c On c.categories_id = p2c.categories_id
Where
( pd.products_name Like '%apparel%'
Or p2c.categories_id In (773, 132, 135, 136, 119, 122, 124, 125, 126, 1749, 1753,
1747, 123, 127, 130, 131, 178, 137, 140, 164, 165, 166,
167, 168, 169, 832, 2045 )
Or p.products_id = 'apparel'
Or p.products_model = 'apparel'
Or Concat( v.vendors_prefix, '-' ) = 'apparel'
Or Concat( v.vendors_prefix, '-', p.products_id ) = 'apparel'
)
And p.products_status = '1'
And c.categories_status = '1'
Group By p.products_id
Order By pd.products_name