Fixed for the next build. Tried to make this as efficient as possible, and at first I wasn't sure it would be possible without sacrificing any. This is because a lot of fields were needed to check membership that are all in different tables. However, after reviewing the EXPLAIN, it looks like the way the JOINs are used avoids opening a temporary table (at least to my recollection, I have seen it say "using temporary" for other queries).