RE: Is there a performance advantage to using placeholders with Sybase?

"Wechsler, Steven" <[email protected]> Mon, 7 Jan 2008 21:28:15 -0500
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <9BFA664319211B4780C5F8A4FB060FF501877D9E@LAZYTOWN.mtvn.ad.viacom.com>
But does Sybase actually have the API functionality to prepare a SQL
statement and then insert the parameters? I seem to recall reading
somewhere that even though DBI supports it, behind the scenes CT-Library
actually has to resend the entire command each time execute() is
called...

________________________________

From: [email protected] [mailto:[email protected]] 
Sent: Monday, January 07, 2008 6:16 PM
To: Wechsler, Steven; [email protected]
Subject: RE: Is there a performance advantage to using placeholders with
Sybase?



I would say yes. Sybase has to prepare the query (compile) every time
you run a prepare. If you only 1 run prepare, then you're having to deal
with query time only. This should be more efficient. I've been told
there's a risk of some sort of funky tempdb usage based on the contents
of the prepare when place holders are involved, but I've really never
noticed an issue. 

 

P.S. If you're looking to optimize, then another thing you should look
at is prepare_cached.

 

________________________________

From: [email protected] [mailto:[email protected]]
On Behalf Of Wechsler, Steven
Sent: Monday, January 07, 2008 4:25 PM
To: [email protected]
Subject: Is there a performance advantage to using placeholders with
Sybase?

 

DBI documentation says that you're better off using placeholders rather
than continully preparing and executing, or using $dbh->do(). Does this
hold true with Sybase?

 

Steve Wechsler | [email protected] 
Sybase/SQL Server/MySQL Database Administrator 
212-846-5683 

MTV Networks