Fixed sql query plan.

Removed commented code