Pregunta de entrevista de Solera

How to optimize a database query with a binary search tree.