MySQL sql-trick for faster queries