You can use stored procedures to view procedure profiling information. The profiling information is the same whether you view it in Sybase Central or in Interactive SQL.
The sa_procedure_profile_summary stored procedure provides information about all of the procedures within the database. You can use this procedure to view the profiling data for stored procedures, functions, events, system triggers, and triggers within the same result set. The following parameters restrict the rows the procedure returns.
p_owner_name Specifies the owner whose objects you want to profile.
p_object_type Specifies the type of object to profile. You can choose from the following five options. Choosing one of these values restricts the result set to only objects of the specified type.
Keep in mind that there may be more items listed than those called specifically by users because one procedure can call another procedure.
The following sections assume that you are already connected to your database as a user with DBA authority and that you have procedure profiling enabled.
To view summary profiling information for all procedures
Execute the sa_procedure_profile_summary stored procedure.
For example, enter:
CALL sa_procedure_profile_summary
From the SQL menu, choose Execute.
A result set with information about all of the procedures in your database appears on the Results pane.
For more information about the sa_procedure_profile_summary stored procedure, see SQL Anywhere Server – SQL Reference.
The sa_procedure_profile stored procedure provides information about individual lines within specific procedures. The result set includes the line number, execution time, and percentage of total execution time for lines within procedures. You can use the following parameters to restrict the rows the procedure returns:
If you do not include any parameters in your query, the procedure returns profiling information for all the procedures that have been called.
To view profiling information for specific lines within procedures
Execute the sa_procedure_profile stored procedure.
For example, enter:
CALL sa_procedure_profile
From the SQL menu, choose Execute.
A result set with profiling information for individual procedure lines appears in the Results pane.
For more information about the sa_procedure_profile stored procedure, see SQL Anywhere Server – SQL Reference.