From be01a89f110823fa6a85b22ff25d8ce99dcbe2ac Mon Sep 17 00:00:00 2001 From: Austin Bergstrom Date: Fri, 21 Aug 2026 16:45:49 -0400 Subject: [PATCH] Document collect_schemas tuning options and partition counting max_tables was only discoverable in conf.yaml.example. Adds the collect_schemas options for PostgreSQL, SQL Server, and MySQL to the Schemas page (the options and defaults differ by engine), documents that PostgreSQL counts each partition individually toward max_tables, and distinguishes this setting from the collect_column_statistics max_tables option. --- .../en/database_monitoring/schema_explorer.md | 52 +++++++++++++++++++ .../setup_postgres/advanced_configuration.md | 5 +- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/hugo/content/en/database_monitoring/schema_explorer.md b/hugo/content/en/database_monitoring/schema_explorer.md index 6d160d0eaaa..49cf4045d14 100644 --- a/hugo/content/en/database_monitoring/schema_explorer.md +++ b/hugo/content/en/database_monitoring/schema_explorer.md @@ -27,6 +27,58 @@ instances: # dbname: '' ``` +### Tuning schema collection + +The `collect_schemas` options available and their defaults differ by database engine. + +**PostgreSQL** + +| Option | Default | Description | +|---|---|---| +| `enabled` | `true` | Set to `false` to disable schema collection. | +| `max_tables` | `300` | Maximum number of tables the Agent collects from the instance. Tables beyond this limit are not collected. | +| `max_columns` | `50` | Maximum number of columns the Agent collects per table. | +| `max_query_duration` | `60` | Maximum duration, in seconds, of the query that collects schema information. | +| `collection_interval` | `600` | Interval, in seconds, between schema collection runs. | + +```yaml +collect_schemas: + enabled: true + max_tables: 1000 +``` + +
Each partition of a partitioned table counts as a separate table toward PostgreSQL's max_tables limit. For example, if table_1 is partitioned into partition_a.table_1 and partition_b.table_1, it counts as two tables, not one. Heavily partitioned databases can reach the default limit of 300 with far fewer logical tables than expected. If tables are missing from the Schemas page, raise max_tables to account for the total partition count. See Handling many relations for more information.
+ +Raising `max_tables` increases the cost of each collection run. On instances with a large number of tables, also consider raising `max_query_duration` and `collection_interval` to reduce load on the database. + +**SQL Server** + +| Option | Default | Description | +|---|---|---| +| `enabled` | `false` | Set to `true` to enable schema collection. | +| `max_tables` | `300` | Maximum number of tables the Agent collects from the instance. Tables beyond this limit are not collected. | +| `collection_interval` | `600` | Interval, in seconds, between schema collection runs. | + +```yaml +collect_schemas: + enabled: true + max_tables: 1000 +``` + +**MySQL** + +| Option | Default | Description | +|---|---|---| +| `enabled` | `false` | Set to `true` to enable schema collection. | +| `collection_interval` | `600` | Interval, in seconds, between schema collection runs. | +| `max_execution_time` | `60` | Maximum duration, in seconds, of the query that collects schema information. | + +```yaml +collect_schemas: + enabled: true + collection_interval: 300 +``` + ## Tables overview The Tables overview lists all tracked tables across your databases, grouped by table name, with the following columns: diff --git a/hugo/content/en/database_monitoring/setup_postgres/advanced_configuration.md b/hugo/content/en/database_monitoring/setup_postgres/advanced_configuration.md index 25a1844eeeb..df6784cb964 100644 --- a/hugo/content/en/database_monitoring/setup_postgres/advanced_configuration.md +++ b/hugo/content/en/database_monitoring/setup_postgres/advanced_configuration.md @@ -39,6 +39,8 @@ instances: replace_digits: true ``` +Partitioning also affects schema collection. Each partition counts individually toward the `max_tables` limit for `collect_schemas`, so partitioned databases may need a higher limit for full coverage. See [Tuning schema collection][2] for details. + ## Raising the sampling rate If you have queries that are relatively infrequent or execute quickly, raise the sampling rate by lowering the `collection_interval` value to collect explain plans more frequently. @@ -75,8 +77,9 @@ instances: | --- | --- | --- | | `enabled` | `false` | Set to `true` to enable column statistics collection. | | `collection_interval` | `3600` | Lower for more responsive statistics (at the cost of more queries against `pg_stats`); raise on very large or busy clusters to reduce query load. | -| `max_tables` | `500` | Raise if you monitor a database with more than 500 tables and want full coverage; lower to cap collection cost. | +| `max_tables` | `500` | Raise if you monitor a database with more than 500 tables and want full coverage; lower to cap collection cost. This limit is separate from the `max_tables` option under `collect_schemas`, which defaults to `300`. | For column statistics to populate, the underlying tables must have had `ANALYZE` (or autoanalyze) run against them at least once — `pg_stats` is empty for tables with no collected statistics. [1]: /database_monitoring/setup_postgres/selfhosted/#create-the-column-statistics-function +[2]: /database_monitoring/schema_explorer/#tuning-schema-collection