I need to check that two columns both appear in a list of IDs. So right now I have this:
SELECT
`main_table`.*
FROM
`activities` AS `main_table`
WHERE
(actor_id IN ('10027' , '11535'))
AND (original_actor_id IN ('10027' , '11535'))
The problem is that the list of IDs can get pretty big; into the thousands. I can't find a way without another temp table that lets me check that two columns are in a list without defining the list twice. I'm concerned that it's an excessively large query to send back and forth from my PHP web server.
max_allowed_packet