mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
b3caf0c99a
#one? and #many? generate a query like `SELECT COUNT(*) FROM posts` under the hood, and then compare if the result is equal (or greater) to 1. That count operation can be really slow for large tables or complex conditions, but there's no need to count all the records in these cases. It's much faster just by adding a limit, like `SELECT COUNT(*) FROM posts LIMIT 2` |
||
---|---|---|
.. | ||
active_record/connection_adapters | ||
activejob | ||
assets | ||
cases | ||
fixtures | ||
migrations | ||
models | ||
schema | ||
support | ||
config.example.yml | ||
config.rb |