i don't really know what it does and doesn't do ... just that it uses clevers to recognise queries that can be better performed differently, without actually trying the different versions.
I was under the impression that it did things like notice that one of the items in a group by is a unique index, so would ignore the rest?
No idea how i got this idea though, so its most probably wrong.