#### 27.12.21.8 The user\_defined\_functions Table

[]()[]()

 The [`user_defined_functions`](performance-schema-user-defined-functions-table.html) table contains a row for each loadable function registered automatically by a component or plugin, or manually by a [`CREATE FUNCTION`](create-function-loadable.html) statement. For information about operations that add or remove table rows, see [Section 5.7.1, “Installing and Uninstalling Loadable Functions”](function-loading.html).

Note

 The name of the [`user_defined_functions`](performance-schema-user-defined-functions-table.html) table stems from the terminology used at its inception for the type of function now known as a loadable function (that is, user-defined function, or UDF).

 The [`user_defined_functions`](performance-schema-user-defined-functions-table.html) table has these columns:

* `UDF_NAME`

   The function name as referred to in SQL statements. The value is `NULL` if the function was registered by a [`CREATE FUNCTION`](create-function.html) statement and is in the process of unloading.

* `UDF_RETURN_TYPE`

   The function return value type. The value is one of `int`, `decimal`, `real`, `char`, or `row`.

* `UDF_TYPE`

   The function type. The value is one of `function` (scalar) or `aggregate`.

* `UDF_LIBRARY`

   The name of the library file containing the executable function code. The file is located in the directory named by the [`plugin_dir`](server-system-variables.html#sysvar_plugin_dir) system variable. The value is `NULL` if the function was registered by a component or plugin rather than by a [`CREATE FUNCTION`](create-function.html) statement.

* `UDF_USAGE_COUNT`

   The current function usage count. This is used to tell whether statements currently are accessing the function.

 The [`user_defined_functions`](performance-schema-user-defined-functions-table.html) table has these indexes:

* Primary key on (`UDF_NAME`)

[`TRUNCATE TABLE`](truncate-table.html) is not permitted for the [`user_defined_functions`](performance-schema-user-defined-functions-table.html) table.

 The `mysql.func` system table also lists installed loadable functions, but only those installed using [`CREATE FUNCTION`](create-function-loadable.html). The [`user_defined_functions`](performance-schema-user-defined-functions-table.html) table lists loadable functions installed using [`CREATE FUNCTION`](create-function-loadable.html) as well as loadable functions installed automatically by components or plugins. This difference makes [`user_defined_functions`](performance-schema-user-defined-functions-table.html) preferable to `mysql.func` for checking which loadable functions are installed.

