# Sys Schema Stored Procedures

- [create\_synonym\_db](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/create_synonym_db.md): The create\_synonym\_db stored procedure creates a new database that contains views mirroring all tables from a source database, useful for creating aliases.
- [optimizer\_switch Helper Functions](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/optimizer_switch-helper-functions.md): These helper functions allow you to easily enable or disable specific optimizer\_switch flags for the current session.
- [ps\_trace\_statement\_digest](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/ps_trace_statement_digest.md): This procedure traces a specific statement digest in the Performance Schema, capturing details about its execution for performance analysis.
- [ps\_trace\_thread](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/ps_trace_thread.md): 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.
- [ps\_truncate\_all\_tables](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/ps_truncate_all_tables.md): This procedure truncates all Performance Schema summary tables, effectively resetting all aggregated performance statistics.
- [statement\_performance\_analyzer](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/statement_performance_analyzer.md): This diagnostic procedure creates a report of the statements currently running or recently run on the server, aiding in performance troubleshooting.
- [table\_exists](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures/table_exists.md): The table\_exists procedure checks for the existence of a specific table, view, or temporary table within a given database.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
