4 ms·
There is an entire world between ORM and PL/SQL. Programmatically constructing SQL statements is also a thing. Just because someone writes SQL does not mean SQL
by harikb 7y ago
There is an entire world between ORM and PL/SQL. Programmatically constructing SQL statements is also a thing. Just because someone writes SQL does not mean
SQL needs to be spread through out code or that we need to have lot of logic in PL/SQL. Of course, there will be cases where a store procedure is desired (any kind of validation that cannot be expressed as fkeys, canonicalization of some core data components etc). I worked on DBs writing SQL for several years with only minimal code as stored procedures.
Of course the database vendor and culture also plays a role. We were primarily a mysql/postgresql shop
- resu_nimda 7y agoHow did you minimize roundtrips between server and DB, or did you find that they were not a big concern? I'm working on a project with a Postgres database, and as it gets more complex I'm moving more stuff into stored procedures, pretty much wherever a single action requires multiple statements in series (e.g. check if this thing exists, check a value, get the id of some other thing, on success update another table). Of course I would prefer to leave as much of it in the middle tier as possible because the ergonomics are better there but I don't want to sacrifice performance.
- monocasa 7y agoI think they're saying that you profile your changes on an individual query. Yeah, if all of your queries are slow, you've got more work to do, but that doesn't change the overall process of optimization.