refactor Where clause handling. use index when possible. also supporting multi value index and compound index