From 74ce12866a5bfae54af01d0c7cc024a759a1a61f Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Wed, 27 Sep 2017 13:17:56 +0800 Subject: [PATCH] Create system-database.md (#201) * Create system-database.md * Address comments * Update format * Add description * Add link for system database --- sql/README.md | 2 +- sql/system-database.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 sql/system-database.md diff --git a/sql/README.md b/sql/README.md index bd08a690a423a..8122571913dc5 100644 --- a/sql/README.md +++ b/sql/README.md @@ -12,7 +12,7 @@ TiDB supports the SQL-92 standard and is compatible with MySQL. To help you easi + TiDB Server Administration - The TiDB Server - The TiDB Data Directory - - The TiDB System Database + - [The TiDB System Database](system-database.md) - [The Proprietary System Variables and Syntax in TiDB](tidb-specific.md) - TiDB Server Logs + Security diff --git a/sql/system-database.md b/sql/system-database.md new file mode 100644 index 0000000000000..3588d33387c13 --- /dev/null +++ b/sql/system-database.md @@ -0,0 +1,36 @@ +--- +title: The TiDB System Database +category: user guide +--- + +# The TiDB System Database + +The TiDB System Database is similar to MySQL, which contains tables that store information required by the server when it runs. + +## Grant System Tables + +These system tables contain grant information about user accounts and their privileges: + +- `user`: user accounts, global privileges, and other non-privilege columns +- `db`: database-level privileges +- `tables_priv`: table-level privileges +- `columns_priv`: column-level privileges + +## Server-Side Help System Tables + +Currently, the `help_topic` is NULL. + +## Statistics System Tables + +- `stats_buckets`: the buckets of statistics +- `stats_histograms`: the histograms of statistics +- `stats_meta`: the meta information of tables, such as the total number of rows and updated rows + +## GC Worker System Tables + +- `gc_delete_range`: to record the data to be deleted + +## Miscellaneous System Tables + +- `GLOBAL_VARIABLES`: global system variable table +- `tidb`: to record the version information when TiDB executes `bootstrap`