I am actually a little surprised by this, and I may be wrong in the understanding of the DB structure, but it seems to me that all the data in fud30_group_cache is already contained in other tables, so why isn't it a view?

By the way, the result generated by the statement above is different from fud30_group_cache: in fud30_group_cache, group_id is always 0, here it is set properly. I am not sure this is the correct behaviour, though, since the key of the caching seems to be (user_id, resource_id) independently of the group_id.

P.S. I am pretty sure this works for MySQL, but the syntax might need to be changed for other engines