I have a problem in a query on my website. whenever this query is performed it takes like 30 seconds to show the results on the website.
i used mysql admin and found the query with the problem. it takes all of the CPU load and even the server stops responding for seconds. im using mac G4 so i thought this shouldnt be a prblem.
this is the query
select * from products where unique_id in (select distinct itemid from item_classification where (classb=207 or classb=211 or classb=234 or classb=221 or classb=237 or classb=240 or classb=239 or classb=250) and (classc=302 or classc=334 or classc=360 or classc=331 or classc=470 or classc=421 or classc=999) )
table (products) has about 2000 records. also the same in table (item_classification). unique_id is indexed. i tried indexing fields (classb) and (classc) but it didnt help.
if you can help me with a tip or an advice i’ll be thankful.