Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » System Procedures » System procedures

sa_procedure_profile system procedure Next Page

sa_procedure_profile_summary system procedure


Reports summary information about the execution times for all procedures, functions, events, or triggers that have been executed in a database. This procedure provides the same information for these objects as the Profile tab in Sybase Central.

Syntax

sa_procedure_profile_summary(
[ filename
[, save_to_file ] ]
)

Arguments
Result set
Column nameData type Description
object_type CHAR(1)The type of object. See the Remarks section below for a list of possible object types.
object_nameCHAR(128)The name of the stored procedure, function, event, or trigger.
owner_nameCHAR(128)The object's owner.
table_nameCHAR(128)The table associated with a trigger (the value is NULL for other object types).
executionsUNSIGNED INTEGERThe number of times each procedure has been executed.
millisecsUNSIGNED INTEGERThe time to execute the procedure, in milliseconds.
foreign_ownerCHAR(128)The database user who owns the foreign table for a system trigger.
foreign_tableCHAR(128)The name of the foreign table for a system trigger.
Remarks

You can use this procedure to:

Since the procedure returns information about the usage frequency and efficiency of stored procedures, functions, events, and triggers, you can use this information to fine-tune slower procedures to improve database performance.

Before you can profile your database, you must enable profiling. See Enabling procedure profiling.

The object_type field of the result set can be:

If you want line by line details for each execution instead of summary information, use the sa_procedure_profile procedure instead.

Permissions

DBA authority required

Side effects

None

See also
Example

The following statement returns the execution time for any procedure, function, event, or trigger that has been executed in the database:

CALL sa_procedure_profile_summary( );

The following statement returns the same summary information as the previous example, and saves it to a file called summaryinfo.txt:

CALL sa_procedure_profile_summary( "summaryinfo.txt", 1 );

Either of the following statements can be used to load stored summary information from a file called summaryinfoOLD.txt:

CALL sa_procedure_profile_summary( "summaryinfoOLD".txt, 0 );
CALL sa_procedure_profile_summary( "summaryinfoOLD.txt" );