TheRobotLearns Platform · ProxySQL: from first install to production

Main Schema Inventory and Table Layers

  • about 20 min read

Learning objectives

  • Interpret `SHOW TABLES FROM main` to inventory core configuration tables, including `clickhouse_users`, `coredump_filters`, `debug_filters`, `debug_levels`, `global_variables`, and `scheduler`.
  • Map configuration tables to the Memory, Runtime, and Disk layers using unprefixed main tables, `runtime_` tables, and the `disk` schema.
  • Describe the purpose of non-protocol tables such as `global_variables`, `scheduler`, `restapi_routes`, `proxysql_servers`, `coredump_filters`, `debug_filters`, and `debug_levels`.
  • Classify MySQL and PostgreSQL configuration tables into common groups, including users, servers, query rules, replication hostgroups, fast routing, and hostgroup attributes, plus MySQL-specific collation, Galera, Group Replication, and SSL parameter tables.
  • State that runtime tables are generated projections of active configuration rather than additional configuration sources, and that `global_settings` is internal persistent metadata without a runtime counterpart.
  • Recall that the disk database mirrors persistent main tables minus runtime tables, while `coredump_filters` is main-only, absent from disk and configuration layers, and must be re-provisioned after restart before a LOAD operation.

Reading the main table list

You run SHOW TABLES FROM main in ProxySQL Admin, the MySQL-compatible interface backed by the Memory layer. The list shows configuration tables that are not MySQL or PostgreSQL specific. The exact list may vary with the ProxySQL version in use and with which modules are operating.

Run this list command:

SHOW TABLES FROM main;

The example list contains clickhouse_users, coredump_filters, debug_filters, debug_levels, global_variables, and scheduler. Protocol-specific configuration and runtime tables are grouped in their own MySQL and PostgreSQL sections.

The core configuration table list also names restapi_routes and proxysql_servers. global_variables holds all ProxySQL global variables. scheduler holds tasks that the Scheduler can execute. restapi_routes defines RESTAPI endpoints. proxysql_servers lists the core nodes in ProxySQL Cluster. coredump_filters selects source locations for the coredump subsystem. debug_filters defines filters that suppress error-log information when debug_levels is enabled in a DEBUG build. debug_levels defines verbosity levels enabled when ProxySQL is compiled in DEBUG mode.

Takeaway: SHOW TABLES FROM main lists non-protocol tables such as clickhouse_users, global_variables, scheduler, and debug tables.

When a restart erases rows

The disk database normally mirrors persistent main tables, except runtime tables. coredump_filters is an exception. It exists only in the main-memory and runtime layers. It is absent from the disk and configuration databases, and there is no released SAVE COREDUMP command.

After every restart, reinsert or provision the desired rows before running a LOAD form. The active set is visible in runtime_coredump_filters with the same schema as coredump_filters.

A runtime table is a generated projection, not another configuration source. You cannot fix a wrong value by writing to runtime_global_variables. The RUNTIME layer cannot be modified directly.

ProxySQL does not activate a change until you load it to RUNTIME. It loses any change you do not save to DISK after restart. ProxySQL may silently revert invalid settings during a runtime load.

Takeaway: coredump_filters has no disk save; rebuild rows after restart, then run LOAD COREDUMP TO RUNTIME.

Compare one table across layers

SHOW TABLES FROM main;
SELECT * FROM global_variables;
SELECT * FROM runtime_global_variables;
SELECT * FROM disk.global_variables;

The first statement lists non-protocol tables in Memory. The second reads global_variables from the Memory layer. The third reads runtime_global_variables, the generated projection used by worker threads. The fourth reads global_variables from the disk schema, the persistent SQLite database.

Try it: config_layer_sim

Connect to ProxySQL Admin and run SHOW TABLES FROM main. The output lists non-protocol tables such as global_variables. Run SELECT * FROM global_variables;, SELECT * FROM runtime_global_variables;, and SELECT * FROM disk.global_variables;. The first reads Memory, the second reads the active RUNTIME projection, and the third reads the disk schema. A change you do not load to RUNTIME is not active, and a change you do not save to DISK is lost after restart.

Sources

Do more with an account

Main Schema Inventory and Table Layers — ProxySQL: from first install to production