That highly depends on the SQL engine of the underlying database and you forgot to mention the scenario:
e.g. Oracle is much faster than Firebird in a client-server scenario under heavy load and many nodes.
The SQL query language itself results in a map. How that map is achieved differs greatly between engines.
Your observation to use stored procedures is usually correct in any form of client-server setting, also from a security point of view.
And speed usually comes with a memory trade-off.
So:
- what is your scenario?
- What database engine are you using
- And what's your budget - if any...