Lesson 2: Running an updated procedure against the baseline procedure

To run an updated procedure against the baseline procedure
  1. In Sybase Central, choose Mode » Application Profiling.

    If the Application Profiling Wizard does not appear, choose Application Profiling » Open Application Profiling Wizard.

  2. On the Welcome page, click Next.

  3. On the Profiling Options page, select Stored Procedure, Function, Trigger, Or Event Execution Time.

  4. Click Finish.

    The database server begins procedure profiling.

  5. In the left pane of Sybase Central, double-click Procedures & Functions.

  6. Right-click the baseline procedure and choose Execute From Interactive SQL. Procedure profiling is enabled, so execution details for the procedure are captured.

  7. Close Interactive SQL.

  8. View the profiling results.

    1. In the left pane of Sybase Central, select the baseline procedure.

    2. Click the Profiling Results tab in the right pane. If no results appear, choose View » Refresh Folder.

      The execution times appear for each line in the baseline procedure.

  9. Save the profiling results.

    1. Right-click the database and choose Properties.

    2. Click the Profiling Settings tab.

    3. Select Save The Profiling Information Currently In The Database To The Following Profiling Log File, and then specify a location and file name for the profiling log file.

    4. Click Apply. Do not close the properties window.

      The procedure profiling information that was just gathered is saved to the specified profiling log file (.plg).

  10. Enable baselining against the profiling log file.

    1. On the Profiling Settings tab of the App_Profiling - DBA Database Properties window, select Use The Profiling Information In The Following Profiling Log File As A Baseline For Comparison.

    2. Browse to and select the profiling log file you created.

    3. Click Apply.

    4. Click OK to close the App_Profiling - DBA Database Properties window.

  11. Make changes to the baseline procedure.

    1. In Sybase Central, choose Mode » Design.

    2. In the left pane, browse to and select the baseline procedure in the Procedures & Functions.

    3. On the SQL tab in the right pane, delete the existing INSERT statement.

    4. Copy and paste the following SQL statement into the procedure:

      INSERT table1 
         SELECT COUNT ( * ) FROM rowgenerator r1, rowgenerator r2, rowgenerator r3 
         WHERE r3.row_num < 250;
    5. Choose File » Save.

  12. In Procedures & Functions, right-click the baseline procedure and choose Execute From Interactive SQL.

  13. Exit Interactive SQL when the procedure completes.