Fast “Exists” Checks with select(1) and LIMIT

9330
0

Avoid loading whole records when you only need to know if something exists. exists? is good; for complex joins, a scoped select(1).limit(1) can be clearer and keeps the DB workload low.