vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| A. Kretschmer wrote: > am Tue, dem 22.01.2008, um 8:49:39 -0500 mailte Mag Gam folgendes: >> I was in an academic meeting where a professor was preaching the reasonswhy >> not to use a stored procedure. He advised to always use SQL instead of a >> procedural language. Can someone please shed some light on this? > > Why not use procedural languages? He told more about the reasons? > I assume that it is true for PostgreSQL as it was for Oracle that it is less costly (in terms of computer resources) to select and filter data at the RDBMS level with a single SQL call than at a higher level that may involve more calls to the RDBMS. That will be even more true if there's a network in between. So if you can do something in SQL, that is likely to be the most efficient way to do it (assuming optimally written code and indexes and whatever). But in the real world some things you might want to do may require such contorted SQL (or may not even be possible in SQL at all) whereas using a procedure would be simpler to write, understand (important for when it needs to be revisited in a year's time and by someone else) and maintain, and you might be able to make it perform better (if needed - why bust a gut and waste money shaving a few minutes off a nightly run when there's nobody there to see it finish anyway?). Maybe the professor just sat in his ivory tower without a foot in the real world, or hadn't seen it since the early 90s? If you're doing a real-world job just do a real-world solution! Nick. __________________________________________________ _______________ Share what Santa brought you https://www.mycooluncool.com |