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

# configurações de sessão default_*

> Configurações de sessão do ClickHouse no grupo default_* gerado.

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
  }}>Tipo</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Padrão</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Pode ser alterado sem reiniciar
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

Essas configurações estão disponíveis em [system.settings](/docs/pt-BR/reference/system-tables/settings) e são geradas automaticamente a partir do [código-fonte](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

<div id="default_materialized_view_sql_security">
  ## default\_materialized\_view\_sql\_security
</div>

<SettingsInfoBlock type="SQLSecurityType" default_value="DEFINER" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.2"},{"label": "DEFINER"},{"label": "Permite definir o valor padrão da opção SQL SECURITY ao criar uma visão materializada"}]}]} />

Permite definir o valor padrão da opção SQL SECURITY ao criar uma visão materializada. [Mais sobre SQL security](/docs/pt-BR/reference/statements/create/view#sql_security).

O valor padrão é `DEFINER`.

<div id="default_max_bytes_in_join">
  ## default\_max\_bytes\_in\_join
</div>

<SettingsInfoBlock type="UInt64" default_value="1000000000" />

Tamanho máximo da tabela do lado direito se um limite for necessário, mas `max_bytes_in_join` não estiver definido.

<div id="default_normal_view_sql_security">
  ## default\_normal\_view\_sql\_security
</div>

<SettingsInfoBlock type="SQLSecurityType" default_value="INVOKER" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.2"},{"label": "INVOKER"},{"label": "Permite definir a opção padrão de `SQL SECURITY` ao criar uma view normal"}]}]} />

Permite definir a opção padrão de `SQL SECURITY` ao criar uma view normal. [Mais sobre SQL security](/docs/pt-BR/reference/statements/create/view#sql_security).

O valor padrão é `INVOKER`.

<div id="default_table_engine">
  ## default\_table\_engine
</div>

<SettingsInfoBlock type="DefaultTableEngine" default_value="MergeTree" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.3"},{"label": "MergeTree"},{"label": "Define o mecanismo de tabela padrão como MergeTree para melhorar a usabilidade"}]}]} />

Mecanismo de tabela padrão usado quando `ENGINE` não é definido em uma instrução `CREATE`.

Valores possíveis:

* uma string que representa qualquer nome válido de mecanismo de tabela

Valor padrão no Cloud: `SharedMergeTree`.

**Exemplo**

Consulta:

```sql theme={null}
SET default_table_engine = 'Log';

SELECT name, value, changed FROM system.settings WHERE name = 'default_table_engine';
```

Resultado:

```response theme={null}
┌─name─────────────────┬─value─┬─changed─┐
│ default_table_engine │ Log   │       1 │
└──────────────────────┴───────┴─────────┘
```

Neste exemplo, qualquer nova tabela que não especifique um `Engine` usará o mecanismo de tabela `Log`:

Consulta:

```sql theme={null}
CREATE TABLE my_table (
    x UInt32,
    y UInt32
);

SHOW CREATE TABLE my_table;
```

Resultado:

```response theme={null}
┌─statement────────────────────────────────────────────────────────────────┐
│ CREATE TABLE default.my_table
(
    `x` UInt32,
    `y` UInt32
)
ENGINE = Log
└──────────────────────────────────────────────────────────────────────────┘
```

<div id="default_temporary_table_engine">
  ## default\_temporary\_table\_engine
</div>

<SettingsInfoBlock type="DefaultTableEngine" default_value="Memory" />

Igual a [default\_table\_engine](/docs/pt-BR/reference/settings/session-settings/default#default_table_engine), mas para tabelas temporárias.

Neste exemplo, qualquer nova tabela temporária que não especifique um `Engine` usará o mecanismo de tabela `Log`:

Consulta:

```sql theme={null}
SET default_temporary_table_engine = 'Log';

CREATE TEMPORARY TABLE my_table (
    x UInt32,
    y UInt32
);

SHOW CREATE TEMPORARY TABLE my_table;
```

Resultado:

```response theme={null}
┌─statement────────────────────────────────────────────────────────────────┐
│ CREATE TEMPORARY TABLE default.my_table
(
    `x` UInt32,
    `y` UInt32
)
ENGINE = Log
└──────────────────────────────────────────────────────────────────────────┘
```

<div id="default_view_definer">
  ## default\_view\_definer
</div>

<SettingsInfoBlock type="String" default_value="CURRENT_USER" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.2"},{"label": "CURRENT_USER"},{"label": "Permite definir a opção `DEFINER` padrão ao criar uma view"}]}]} />

Permite definir a opção `DEFINER` padrão ao criar uma view. [Mais sobre SQL security](/docs/pt-BR/reference/statements/create/view#sql_security).

O valor padrão é `CURRENT_USER`.
