SELECT SQL_CACHE photograph.imageid, photograph.imagepath, photograph.thumbnail_width, photograph.thumbnail_height, photograph.base_filename, photograph.thumbnail,photograph.imagepath,photograph.image_width, photograph.image_height, photograph.file_size, IFNULL(total_views,0) as total_views FROM photograph LEFT JOIN image_views_report ON photograph.imageid = image_views_report.imageid WHERE celebid = 1193 AND image_type='P' GROUP BY photograph.imageid, photograph.imagepath, photograph.thumbnail_width, photograph.thumbnail_height, photograph.base_filename, photograph.thumbnail,photograph.imagepath,photograph.image_width, photograph.image_height, photograph.file_size ORDER BY base_filename DESC, date_added DESC LIMIT 0,10