Check if empty, use MIN(), explain query, correct id