Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
In Sybase Central, you can save procedure profiling results to file to use as baseline information. For example, if you are making incremental changes to a procedure to see if it runs faster, you can run it after each change you make, and compare the results to the results that were saved to file.
In order to understand how to use baselining with procedure profiling in Sybase Central, you must first be familiar with the results provided for procedure profiling. See Analyzing procedure profiling results.
Enable procedure profiling on the database you wish to profile.
Connect to your database as the DBA.
Choose Mode > Application Profiling.
If the Application Profiling wizard appears, follow the wizard instructions.
If the wizard does not appear, choose Application Profiling > Open Application Profiling wizard, and then follow the wizard instructions.
On the Profiling Options page of the Application Profiling wizard, select Stored Procedure, Function, Trigger or Event Execution Time. Do not select any of the other options.
The database server begins procedure profiling. If you attempt to switch to another mode, the database server asks whether you want to continue procedure profiling. Select No to continue working in other modes while profiling continues.
Right-click the procedure in the Procedures & Functions folder and choose Execute From Interactive SQL.
The database server executes the procedure from Interactive SQL. Since procedure profiling is enabled, execution details for the procedure are captured.
Close Interactive SQL.
Save the profiling results.
Right-click the database and choose Properties.
The Database property sheet for the database appears.
Click the Profiling Settings tab.
Select Save the Profiling Information Currently in the Database to the Following Profiling Log File, and then choose a location and file name for the profiling log file.
The procedure profiling information gathered from the time procedure profiling was enabled is saved to the specified profiling log file (.plg).
Enable baselining against the profiling log file.
On the Profiles Settings tab of the Database property sheet, select Use the Profiling Information in the Following Profiling Log File as a Baseline for Comparison.
Browse to and select the profiling log file you created.
Click OK to close the Database property sheet.
Make the desired changes to the procedure.
In the left pane, browse to, and select, the procedure in the Procedures & Functions folder.
On the SQL tab in the right pane, make the desired changes to the SQL code for the procedure.
Choose File > Save.
Right-click the procedure and choose Execute From Interactive SQL.
The database server executes the procedure from Interactive SQL.
Close Interactive SQL.
In the right pane in Sybase Central, click the Profiling Results tab to view execution details.
Notice that there are two new columns: Execs. +/-, and ms. +/-. These columns result from comparing statistics in the profiling log file to the statistics captured during the most recent execution of procedure. Specifically, they compare number of executions, and duration of execution, respectively, for each line of code in the procedure.
Typically, you are interested in the ms. +/- column, which indicates whether you have improved execution time for lines of code in the procedure. Faster times are indicated by a minus sign and red font. Slower times are indicated by no sign, and green font. For example, -3 indicates that the line of code in the procedure ran 3 milliseconds faster than the baseline.