How to get the information of the optimizer of sql server? The info like total optimization time, the time spent on each stage of optimization, the number of alternative plans and the cost of each alternative plan. Is there any way to get these info using sql server 2008?
You should check out the SQL Management Studio

It will let you see many things about your query. I know it will show you the cost of executing the query. It will also show you the cost of each step of the execution. 

http://msdn.microsoft.com/en-us/library/ms178071(v=sql.105).aspx

http://msdn.microsoft.com/en-us/library/ms191194(v=sql.105).aspx