[ticket/12408] Simplified queries

PHPBB3-12408