Fork me on GitHub
#sql
<
2019-10-06
>
David Pham15:10:03

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

kulminaator15:10:11

"query one" ?

kulminaator15:10:09

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

kulminaator15:10:43

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

seancorfield16:10:47

@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.