Can someone look at this sql statement posted to MySql, there should be fewer then 200 records returned and it is taking forever.
Two Tables
images:
index on imageid - primary
index on org_name - normal
Image_cat
Index on imageid = normal
Image_cat is a many to many table
Query
Select Distinct images.image_name, images.imagid, images.inks,images.org_name,image_cat.catid
FROM images_cat, images
WHERE
image_cat.catid='3' AND image_cat.imageid=images.imageid
OR images.org_name='Delta';
IF I change the OR to and AND the response snaps back, chaning to OR is slow and returns incorrect values.
Any guidence is appreciated
Keith