Perrin Harkins writes:
 > >  > I have found that stored procedures + perl module wrapper around the
 > procs.
 > >  > is a nice, balanced approach.
 > >  >
 > >  > The procs. give a nice performance boost as they are precompiled into
 > the
 > >  > server (we use Sybase).
 > >
 > > They are definitely faster, and significantly so.
 > 
 > Maybe so for Sybase.  In Oracle, your SQL statements get cached anyway, as
 > long as you're using bind variables instead of just dynamically building the
 > SQL strings.  (They get cached even if you don't use bind variables, but
 > they'll quickly overflow the cache if you keep changing them with each new
 > value in the WHERE clause.)

Actually I did benchmark this for Sybase, both with stored procs and
with SQL statements with bind variables.

The stored procs are still faster, and make it easier in a non-trivial
organization (where SQL code and perl code may be worked on by
different people) to separate the database logic somewhat, and give
SQL developpers and/or DBAs an easy way to tune SQL requests without
having to touch the application code.

 > 
 > > Using RPC calls instead of language commands also improves speed, and
 > > solves the "quoting" problem, too.
 > 
 > The same goes for bind variables.

Agreed.

Michael
-- 
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
[EMAIL PROTECTED] - [EMAIL PROTECTED]
International Sybase User Group - http://www.isug.com

Reply via email to