> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures.md).

# Sys Schema Stored Procedures

{% columns %}
{% column %}
{% content-ref url="/pages/ZKXPAQOsvcq8FCo2WRQK" %}
[create\_synonym\_db](/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/create_synonym_db.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
The create\_synonym\_db stored procedure creates a new database that contains views mirroring all tables from a source database, useful for creating aliases.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/esEtvTZj4skRCKJmBuop" %}
[optimizer\_switch Helper Functions](/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/optimizer_switch-helper-functions.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
These helper functions allow you to easily enable or disable specific optimizer\_switch flags for the current session.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/qf3Sh94vlXxeTJBbiPke" %}
[ps\_trace\_statement\_digest](/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/ps_trace_statement_digest.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This procedure traces a specific statement digest in the Performance Schema, capturing details about its execution for performance analysis.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/6RckO66tatMA56956AHF" %}
[ps\_trace\_thread](/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/ps_trace_thread.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
The ps\_trace\_thread procedure captures a trace of Performance Schema instrumentation for a specific thread and dumps it to a .dot formatted graph file.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/1p3TSfyzWx0Cq9CyM1tM" %}
[ps\_truncate\_all\_tables](/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/ps_truncate_all_tables.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This procedure truncates all Performance Schema summary tables, effectively resetting all aggregated performance statistics.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/rYfumbBf7lTRAhkSufCB" %}
[statement\_performance\_analyzer](/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/statement_performance_analyzer.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This diagnostic procedure creates a report of the statements currently running or recently run on the server, aiding in performance troubleshooting.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/GsQrPTUFoNMeBuNwlGew" %}
[table\_exists](/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/table_exists.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
The table\_exists procedure checks for the existence of a specific table, view, or temporary table within a given database.
{% endcolumn %}
{% endcolumns %}
