Add a LIMIT 1 clause for a unique index, and add tests for this