|
|
sybperl-l Archive
Up Prev Next
From: "Ed Avis" <eda at waniasset dot com>
Subject: RE: Is there a performance advantage to using placeholders with Sybase?
Date: Jan 8 2008 3:09PM
Steven Wechsler wrote:
>I am working on a script to recover whatever data I can on a
>table that has "692" errors (similar to the "605" error, the
>bane of every Sybase
>DBA) by querying the corrupt table based on explicit key
>values and retrieving each row that I can. This can't be
>batched in SQL because once that error hits the SQL batch is
>terminated, but in Perl I can take action based on that error
>(try to retrieve the data from a different server which has an
>older version of the table).
Ah, I see - you have some unusual requirements :-(.
I guess you could try a binary search across key values, if there are lots of them and only a few rows are bad. You could try running your script on the server host itself to cut network latency. Instead of a lengthy insert query you could just 'select some_col from bad_table where key = ?' and use that to make a list of good keys and bad keys. Once you have the list of good keys getting all the data out will be straightforward using a temp table and a single select query.
But anyway, I guess calling a stored proc using CTlib directly as discussed earlier in this thread is the fastest way to run such a proc.
--
Ed Avis
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
|