Code Analyst Tutorial

From RapidSQL
Jump to: navigation, search

Go Up to Code Analyst

The following tutorial guides you through the process of using the Code Analyst.

Creating a Code Analyst Session

  1. On the Tools menu, select Code Analyst.
    Initially, Code Analyst installs the repository tables. For more information, see Installing Code Analyst. Then Rapid SQL opens the Code Analyst to the Run Summary tab.
  2. On the Code Analyst Tools toolbar, click the Create New Collection button.
    Rapid SQL opens the first panel of the Code Analyst Wizard.
  3. Select the individual object or group of objects to analyze. In this example, an individual stored procedure (CREATE_ADMISSION2) is selected.
    Tip: Code Analyst does not let you select objects that do not have stored procedures.
  4. Click Next.
    If the object(s) selected to be analyzed requires parameters, the second panel of the wizard prompts you to enter the parameters.
  5. Double-click the object to set the parameters.
  6. For IBM DB2 LUW for Open Systems and Oracle, the Compile button opens the Confirm Compile dialog box that lets you compile the objects to ensure that the Code Analyst can capture the time metrics.
  7. Click Finish.
    Code Analyst displays a message that the Code Analyst will run longer than the actual code. Then Code Analyst analyzes the objects, using the IDERA SQL Debugger to profile and then opens the Run Detail tab.
    Tip: You can select the "Please do not show me this dialog again" option in the dialog box or set the option on the Code Analyst Options.
    By163ff0.jpg

Identifying and Fixing Bottlenecks Using Code Analyst

The Run Detail tab displays the total time for the objects being analyzed. The tab information may be enough to identify the potential bottleneck.

  1. To view more detailed information, double-click the Unit Name.
    Code Analyst opens to the Unit Detail tab.
    By163ff8.jpg
    The Unit Detail Tab displays the object code and other information related to the individual lines of code. You can determine which line of code is taking too long and why. The Unit Detail Tab is where you troubleshoot, and then resolve the problem in the Modifying objects using editors.
  2. In Rapid SQL, open the object editor, and then modify the code on the Definition tab.
  3. Click Alter.
  4. In Code Analyst, on the Unit Detail Tab, click Execute.

Comparing Code Analyst Sessions

  1. Click the Comparison tab.
    By16b49d.jpg
    Code Analyst has a Comparison facility to allow quick compares of two object executions, showing the base time and the new time, as well as the time differences. The Comparison tab lets you compare which of the two procedures or functions ran faster.
  2. Examine the Time Diff which indicates improvement to code.
  3. If necessary, continue to modify the code on the Definition tab of the object editor, and then press Alter.
  4. In Code Analyst, on the Unit Detail Tab, click Execute.
  5. Examine the Time Diff until the bottleneck is solved.

Common Tasks