Solera interview question

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