Heavily improved SQL queries usage for guilds.