Is the "%s%%" supposed to be a printf()
code, so the actual query looks like "log_title like 'Prefix%'"? In that case you should use logging_logindex instead of logging_userindex
so as to take advantage of the index on (log_namespace, log_title,
log_timestamp). If possible you might also change it to "order by log_title, log_timestamp" to make it even faster, although I suspect that won't fit with whatever you're trying to do.
What was the original query before you tried to add actor and comment table stuff to it?