Use array index instead of extra boolean when generating where clause.