> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# max_table_* server settings

> ClickHouse server settings in the max_table_* generated group.

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>Type</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Default</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Changeable without restart
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

These settings configure the ClickHouse server and are autogenerated from ClickHouse source.

<h2 id="max_table_num_to_throw">
  max\_table\_num\_to\_throw
</h2>

<SettingsInfoBlock type="UInt64" default_value="0" changeable_without_restart="Yes" />

If number of tables is greater than this value, server will throw an exception.

The following tables are not counted:

* view
* remote
* dictionary
* system

Only counts tables for database engines:

* Atomic
* Ordinary
* Replicated
* Lazy

<Note>
  A value of `0` means no limitation.
</Note>

**Example**

```xml theme={null}
<max_table_num_to_throw>400</max_table_num_to_throw>
```

<h2 id="max_table_num_to_warn">
  max\_table\_num\_to\_warn
</h2>

<SettingsInfoBlock type="UInt64" default_value="5000" changeable_without_restart="Yes" />

If the number of attached tables exceeds the specified value, clickhouse server will add warning messages to `system.warnings` table.

**Example**

```xml theme={null}
<max_table_num_to_warn>400</max_table_num_to_warn>
```

<h2 id="max_table_size_to_drop">
  max\_table\_size\_to\_drop
</h2>

<SettingsInfoBlock type="UInt64" default_value="50000000000" changeable_without_restart="Yes" />

Restriction on deleting tables.

If the size of a [MergeTree](/docs/reference/engines/table-engines/mergetree-family/mergetree) table exceeds `max_table_size_to_drop` (in bytes), you can't delete it using a [`DROP`](/docs/reference/statements/drop) query or [`TRUNCATE`](/docs/reference/statements/truncate) query.

<Note>
  A value of `0` means that you can delete all tables without any restrictions.

  This setting does not require a restart of the ClickHouse server to apply. Another way to disable the restriction is to create the `<clickhouse-path>/flags/force_drop_table` file.
</Note>

**Example**

```xml theme={null}
<max_table_size_to_drop>0</max_table_size_to_drop>
```
