Hello,
Background:
Sybase ASE 15.0.3 is used on a Solaris 10 platform as a reporting database. During the day, daily transactions are streamed into the database. Reporting stored procedures are run in the evening via PERL scripts. Each client has a database. There could be multiple client database per ASE server. Reporting stored procedures are kicked off in parallel for each client database on the ASE server. Also, up to 4 reporting stored procedures are running simultaneously per client.
Problem:
On an ASE server with 2 client databases, we are dealing with a problem. One stored procedure is performing poorly. A home-grown process check and reports for long-running transactions (anything longer than 2 hours in master..syslogshold). This process also reports the tempdb usage and the output of a sp_showplan for the offending SPID. When the SQL at line number reported by the sp_showplan is extracted and run manually with ISQL, the query completes in a couple of minutes and with the same plan as it is in the stored procedure!
The server-wide optimizer goal is set to allrows_dss.
I can provide the offending SQL along with its showplan, statistics for the tables involved, tempdb usage at the time of execution of this SQL.
I would appreciate any help in understanding/resolving this problem.
Thanks,
Anil