Re: MySQL and set complements

2011-07-08 Thread Johnny Withers
Leonardo, I think a new compound key on email_id and activity in the activities table may help. I'm not sure if this will help or not, Its hard to test w/o having a large data set to test against. On Thu, Jul 7, 2011 at 9:07 PM, Leonardo Borges leonardoborges...@gmail.com wrote: Sure can:

Re: MySQL and set complements

2011-07-08 Thread Leonardo Borges
Hi Johnny, I just gave that a try but it didn't help as I suspected. I still believe the problem is in mysql not being able to handle set subtractions. Therefore, it has to perform the work harder to return the rows that represent a no match with NULL values in place so they can then be filtered

Re: MySQL and set complements

2011-07-08 Thread Johnny Withers
What did the explain output look like after the new index? On Fri, Jul 8, 2011 at 8:53 AM, Leonardo Borges leonardoborges...@gmail.com wrote: Hi Johnny, I just gave that a try but it didn't help as I suspected. I still believe the problem is in mysql not being able to handle set

Re: MySQL and set complements

2011-07-08 Thread Leonardo Borges
Same as before, but with the new index listed in the possible keys: ++-+---+---+--+--+-+++-+ | id | select_type | table | type | possible_keys | key | key_len | ref

Re: MySQL and set complements

2011-07-08 Thread mos
Leonardo, What happens when you use force index(user_id) ? See http://dev.mysql.com/doc/refman/5.1/en/index-hints.html Mike At 09:19 AM 7/8/2011, you wrote: Same as before, but with the new index listed in the possible keys: