Reports summary information about the execution times for all procedures, functions, events, or triggers that have been executed in a database.
sa_procedure_profile_summary(
[ filename
[, save_to_file ] ] )
Column Name | Data Type | Description |
---|---|---|
object_type | CHAR(1) | The type of object. See the Remarks section below for a list of possible object types. |
object_name | CHAR(128) | The name of the stored procedure, function, event, or trigger. |
owner_name | CHAR(128) | The object's owner. |
table_name | CHAR(128) | The table associated with a trigger (the value is NULL for other object types). |
executions | UNSIGNED INTEGER | The number of times each procedure has been executed. |
millisecs | UNSIGNED INTEGER | The time to execute the procedure, in milliseconds. |
foreign_owner | CHAR(128) | The database user who owns the foreign table for a system trigger. |
foreign_table | CHAR(128) | The name of the foreign table for a system trigger. |
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.
f you want line by line details for each execution instead of summary information, use the sa_procedure_profile procedure instead.
You must have EXECUTE privilege on the system procedure, as well as the the MONITOR or MANAGE PROFILING system privilege.
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 summaryinfo.txt:
CALL sa_procedure_profile_summary( 'summaryinfo'.txt, 0 ); CALL sa_procedure_profile_summary( 'summaryinfo.txt' );