something doesn't add up here
your inner query uses a column called "answer" in the table called "submit_web_data"
but the SHOW CREATE TABLE you posted was for a table called "web_data" and it's lacking that column
you changed your table already, perhaps?
anyhow, let's assume your tables are as you first posted them
run this --
Code:
ALTER TABLE submit_web_data
ADD INDEX (category,answer,ix_id)
then your query would be this --
Code:
SELECT web_for_indexing.email
FROM submit_web_data
INNER
JOIN web_for_indexing
ON web_for_indexing.id = submit_web_data.ix_id
WHERE submit_web_data.category = $category
AND submit_web_data.answer = 'yes'
Bookmarks