cow.vs.cow Posted February 9, 2009 Share Posted February 9, 2009 hello all ! i hope you'll have some good answers for me. lest start. i have 3 tables A - inno_db - has 500,000 records B - inno_db - has 40,000 records C - temporary table - inno_db - has 80,000 records all tabels are growing up more and more. i need all the records from A that they are NOT in B AND NOT in C using NOT IN is taking way to long and i'm sure that there's another better way.. thanx all Link to comment https://forums.phpfreaks.com/topic/144471-help-writing-a-big-query/ Share on other sites More sharing options...
fenway Posted February 9, 2009 Share Posted February 9, 2009 Yup... it's called a LEFT JOIN. Link to comment https://forums.phpfreaks.com/topic/144471-help-writing-a-big-query/#findComment-758081 Share on other sites More sharing options...
cow.vs.cow Posted February 9, 2009 Author Share Posted February 9, 2009 i have tried it. isn't anything faster than this ? Link to comment https://forums.phpfreaks.com/topic/144471-help-writing-a-big-query/#findComment-758083 Share on other sites More sharing options...
fenway Posted February 15, 2009 Share Posted February 15, 2009 i have tried it. isn't anything faster than this ? Faster then a left join... unlikely. Let's see the EXPLAIN output for each one. Link to comment https://forums.phpfreaks.com/topic/144471-help-writing-a-big-query/#findComment-762672 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.