Hacker News new | ask | show | jobs
by vampirechicken 4009 days ago
You appear to be assuming that the limit is applied while fetching tuples, rather than while filtering the tuple set after fetch.

It occurs to me that if you handle LIMIT during fetch, you'll add complexity the fetch, and might only see run time gains in the cases where the number of desired rows is small.

If a column contains unique data it should be marked as such in whatever way your RDBMS requires (e.g. UNIQUE constraint and/or UNIQUE index)