Oracle interview question

How would you implement an RDBMS optimizer?