We are trying to figure how to optimize a query (taking around 100ms), and running profile we see
Creating Sort Index using
75% of the total time. First, what exactly effects creating the sort index? Is it disk/io?
Second, is there any optimization we can make to the query itself?
SELECT r.`id`, r.name, r.public_uri, rv.version, rv.interpreter, rv.notes, rv.content, r.added, r.added_by, r.modified, r.modified_by, r.public, r.public_by FROM recipe_heads rh, recipes r, recipe_versions rv WHERE rh.recipe = r.`id` AND rh.recipe_version = rv.`id` AND r.`id` = rv.recipe ORDER BY r.added DESC