Depends on a lot of factors, but most databases have some overhead per call, especially if it happens over a network. If you can write some procedural code that runs on the database and eliminate calls and network traffic that may be a win. Then there is the SQL overhead of parsing and compiling queries, various forms of stored procedures can mitigate that by having a function that is compiled once, and then called with different input data.
How this all works varies a lot between databases, so what works in one may not be optimal in another.
How this all works varies a lot between databases, so what works in one may not be optimal in another.