# Sys Schema

- [Sys Schema sys\_config Table](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-sys_config-table.md): The sys\_config table holds persistent configuration options for the Sys Schema, stored using the Aria storage engine to maintain settings across restarts.
- [Sys Schema Stored Functions](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions.md): Explore sys\_schema stored functions in MariaDB Server. These functions simplify querying performance and configuration data, offering a user-friendly interface for database diagnostics.
- [extract\_schema\_from\_file\_name](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/extract_schema_from_file_name.md): This function takes a file path and returns the schema name it belongs to, assuming the file is located within the schema's directory.
- [extract\_table\_from\_file\_name](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/extract_table_from_file_name.md): This function extracts and returns the table name from a given file path, determined solely by parsing the path string.
- [format\_bytes](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/sys_schema_format_bytes.md): Convert bytes to a human-readable string. This function formats a numeric byte count into units like KiB, MiB, GiB, up to EiB.
- [format\_path](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/format_path.md): The format\_path function replaces specific system paths in a given string with their corresponding system variable names for better readability.
- [format\_statement](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/format_statement.md): This function formats and truncates an SQL statement string to a specified length, making it suitable for display in summary views.
- [format\_time](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/format_time.md): The format\_time function converts a time value in picoseconds into a human-readable string with appropriate units (e.g., ms, s, min).
- [list\_add](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/list_add.md): This function appends a value to a comma-separated list of values, which is useful for modifying system variables that take list values.
- [list\_drop](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/list_drop.md): The list\_drop function removes a specified value from a comma-separated list, returning the modified list.
- [ps\_is\_account\_enabled](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/ps_is_account_enabled.md): This function checks whether a specific user account is enabled for instrumentation in the Performance Schema setup\_actors table.
- [ps\_is\_consumer\_enabled](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/ps_is_consumer_enabled.md): This function returns YES or NO indicating whether a specific consumer is currently enabled in the Performance Schema.
- [ps\_is\_instrument\_default\_enabled](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/ps_is_instrument_default_enabled.md): This function checks if a given Performance Schema instrument is enabled by default, returning YES or NO.
- [ps\_is\_instrument\_default\_timed](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/ps_is_instrument_default_timed.md): This function checks if a specific Performance Schema instrument is timed by default, returning YES or NO based on the server's default configuration.
- [ps\_is\_thread\_instrumented](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/ps_is_thread_instrumented.md): The ps\_is\_thread\_instrumented function checks whether a specific thread ID is currently instrumented by the Performance Schema.
- [ps\_thread\_account](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/ps_thread_account.md): This function returns the user account (username@hostname) associated with a specific Performance Schema thread ID.
- [ps\_thread\_id](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/ps_thread_id.md): The ps\_thread\_id function returns the internal Performance Schema thread ID associated with a given connection ID.
- [ps\_thread\_stack](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/ps_thread_stack.md): This function returns a JSON-formatted stack trace of all statements, stages, and events for a given thread, useful for deep diagnostics.
- [ps\_thread\_trx\_info](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/ps_thread_trx_info.md): The ps\_thread\_trx\_info function returns a JSON object detailing the current transaction and executed statements for a specific thread.
- [quote\_identifier](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/quote_identifier.md): This function quotes a given string with backticks to ensure it can be safely used as an identifier in SQL statements.
- [sys\_get\_config](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/sys_get_config.md): The sys\_get\_config function retrieves the value of a specified configuration option from the sys\_config table, or a user variable if set.
- [version\_major](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/version_major.md): This function returns the major version number of the MariaDB Server instance (e.g., 10 from 10.6.4).
- [version\_minor](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/version_minor.md): This function returns the minor version number of the MariaDB Server instance, such as the 6 in 10.6.4.
- [version\_patch](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-functions/version_patch.md): This function returns the patch release version number of the MariaDB Server instance, such as the 4 in 10.6.4.
- [Sys Schema Stored Procedures](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-stored-procedures.md): Explore sys\_schema stored procedures in MariaDB Server. These procedures simplify complex administrative and diagnostic tasks, offering streamlined access to performance and configuration insights.
- [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.
- [Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views.md): Explore sys\_schema views in MariaDB Server. These views offer simplified, aggregated insights into server performance, I/O, and memory usage, making diagnostics and monitoring easier.
- [host\_summary and x$host\_summary Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/host_summary-and-xhost_summary-sys-schema-views.md): The host\_summary views provide a high-level overview of activity per client host, including statement counts, file I/O, and connection statistics.
- [host\_summary\_by\_file\_io and x$host\_summary\_by\_file\_io Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/host_summary_by_file_io-and-xhost_summary_by_file_io-sys-schema-views.md): These views summarize file I/O events grouped by client host, detailing total I/O counts and latency to identify hosts generating heavy disk traffic.
- [host\_summary\_by\_file\_io\_type and x$host\_summary\_by\_file\_io\_type Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/host_summary_by_file_io_type-and-xhost_summary_by_file_io_type-sys-schema-v.md): These views provide a breakdown of file I/O events by event type (e.g., read, write) for each host, helping to characterize the I/O workload.
- [host\_summary\_by\_stages and x$host\_summary\_by\_stages Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/host_summary_by_stages-and-xhost_summary_by_stages-sys-schema-views.md): These views summarize statement execution stages grouped by host, showing where threads spend the most time during query processing.
- [host\_summary\_by\_statement\_type and x$host\_summary\_by\_statement\_type Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/host_summary_by_statement_type-and-xhost_summary_by_statement_type-sys-sche.md): These views aggregate executed statements by type (e.g., SELECT, INSERT) and host, providing statistics on frequency and latency.
- [host\_summary\_by\_statement\_latency and x$host\_summary\_by\_statement\_latency Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/sys-schema-views-host_summary_by_statement_latency-and-xhost_summary_by_sta.md): These views summarize statement statistics grouped by host, sorted by total latency, helping to identify hosts running the most time-consuming queries.
- [innodb\_buffer\_stats\_by\_schema and x$innodb\_buffer\_stats\_by\_schema Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/innodb_buffer_stats_by_schema-and-xinnodb_buffer_stats_by_schema-sys-schema.md): These views summarize InnoDB buffer pool usage, showing the amount of memory and number of pages allocated to each database schema.
- [innodb\_buffer\_stats\_by\_table and x$innodb\_buffer\_stats\_by\_table Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/innodb_buffer_stats_by_table-and-xinnodb_buffer_stats_by_table-sys-schema-v.md): These views provide a granular breakdown of InnoDB buffer pool usage by individual tables, sorted by buffer allocation size.
- [innodb\_lock\_waits and x$innodb\_lock\_waits Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/innodb_lock_waits-and-xinnodb_lock_waits-sys-schema-views.md): These views summarize lock wait information, linking waiting transactions to blocking transactions to help diagnose deadlocks and contention.
- [io\_by\_thread\_by\_latency and x$io\_by\_thread\_by\_latency Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/io_by_thread_by_latency-and-xio_by_thread_by_latency-sys-schema-views.md): These views rank threads by I/O latency, making it easier to identify specific threads that are consuming the most disk resources.
- [io\_global\_by\_file\_by\_bytes and x$io\_global\_by\_file\_by\_bytes Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/io_global_by_file_by_bytes-and-xio_global_by_file_by_bytes-sys-schema-views.md): These views summarize global file I/O statistics grouped by file path, sorted by total bytes read and written.
- [io\_global\_by\_file\_by\_latency and x$io\_global\_by\_file\_by\_latency Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/io_global_by_file_by_latency-and-xio_global_by_file_by_latency-sys-schema-v.md): These views summarize global file I/O statistics grouped by file path, sorted by total latency to highlight slow I/O targets.
- [io\_global\_by\_wait\_by\_bytes and x$io\_global\_by\_wait\_by\_bytes Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/io_global_by_wait_by_bytes-and-xio_global_by_wait_by_bytes-sys-schema-views.md): These views summarize global I/O consumers by event name, displaying total bytes read and written to identify high-throughput events.
- [io\_global\_by\_wait\_by\_latency and x$io\_global\_by\_wait\_by\_latency Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/io_global_by_wait_by_latency-and-xio_global_by_wait_by_latency-sys-schema-v.md): These views summarize global I/O consumers by event name, sorted by total latency, helping to pinpoint slow I/O event types.
- [latest\_file\_io and x$latest\_file\_io Sys Schema Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/latest_file_io-and-xlatest_file_io-sys-schema-views.md): These views display the most recent file I/O events, providing a real-time look at which files are being accessed by the server.
- [memory\_by\_host\_by\_current\_bytes and x$memory\_by\_host\_by\_current\_bytes Views](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/memory_by_host_by_current_bytes-and-xmemory_by_host_by_current_bytes-views.md): These views summarize current memory usage grouped by client host, enabling administrators to track memory consumption per connected host.
- [metrics Sys Schema View](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/metrics-sys-schema-view.md): The metrics view consolidates key performance metrics from Global Status, InnoDB Metrics, and memory summaries into a single unified table.
- [privileges\_by\_table\_by\_level Sys Schema View](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/privileges_by_table_by_level-sys-schema-view.md): The privileges\_by\_table\_by\_level view lists granted privileges broken down by table and the level (Global, Schema, or Table) at which they were granted.
- [schema\_auto\_increment\_columns Sys Schema View](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/schema_auto_increment_columns-sys-schema-view.md): The schema\_auto\_increment\_columns view lists tables with AUTO\_INCREMENT columns, showing the current value and the maximum allowed value for the column type.
- [schema\_object\_overview Sys Schema View](https://mariadb.com/docs/server/reference/system-tables/sys-schema/sys-schema-views/schema_object_overview-sys-schema-view.md): The schema\_object\_overview view provides a count of different database objects (such as tables, views, and routines) within each schema on the server.


---

# 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.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.
