Fork me on GitHub
David Pham15:10:03

Noob question: are queries with limit 1 as fast as queries with query one?


"query one" ?


e.g. in postgresql limit 1 stops the query right when it finds the first result


i use the "limit x" often to quickly determine presence of certain types of data


@neo2551 if you're asking about execute! vs execute-one!, as the documentation says the latter is for SQL operations that you know will produce only one "row" such as update/delete and simple insert. It's purely a convenience so you don't have to unwrap a vector that only has one element.