[Sqlrelay-discussion] Sybase/Perl performance
Brought to you by:
mused
|
From: Carlos V. <cve...@em...> - 2010-02-01 21:24:48
|
I have a perl use question. I am implementing SQLRelay with Sybase and Perl. I want to replace my use of Sybase::CTlib
However just with initial tests, it seems the first query through SQLRelay takes substantially longer that through CTlib. I have compiled SQLRelay to use the native Sybase C libraries. I am not sure why the query takes what looks like a whole 1/2 second longer than through ctlib.
I have checked to make sure SQLRelay results caching is off, I am using the local unix socket, is there any other option I can configure?
Is there a way to run queries without setting up a cursor?
my $sc=SQLRelay::Connection->new("localhost",9000," /tmp/sybasetest.socket", "dev","devsyb",0,1);
if($sc->ping()){ print "DB PING! Successful connection!\n"; } else { print "FAILED PING! QUITING NOW\n"; exit; }
my $ss=SQLRelay::Cursor->new($sc);
[1129]./test4.pl dev 10
Sending Query 10 times
ctStub: x.........
SqlRelay: x.........
Connect 1: 0 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU)
RunTime1: 1 wallclock secs ( 1.06 usr + 0.05 sys = 1.11 CPU)
Connect 2: 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
RunTime2: 4 wallclock secs ( 2.64 usr + 0.02 sys = 2.66 CPU)
Printing Results RowCount|517|
Test Complete!
If I run the same query 1000 times, sqlrelay seems to out perform ctlib because after the first two queries subsequent ones run much faster than ctlib which has the same performance query after query. Whereas sqlrelay is slow the first two times, then super fast.
My application is not going to run the same query 1000 times though, each query will be different, so I need the first query to be as fast as using ctlib. Any suggestions would be helpful?
CJ Vergara
|