MySQL SQL optimization

MySQL SQL optimization