Hi saurabh,
The Force.com query optimizer:
# Determines the best index from which to drive the query, if possible, based on filters in the query
# Determines the best table to drive the query from if no good index is available
# Determines how to order the remaining tables to minimize cost
# Injects custom foreign key value tables as needed to create efficient join paths
# Influences the execution plan for the remaining joins, including sharing joins, to minimize database input/output (I/O)
# Updates statistics.
Thanks.