Skip to content

Commit

Permalink
Recommend disallow_full_table_scans session var
Browse files Browse the repository at this point in the history
Fixes DOC-7875
  • Loading branch information
rmloveland committed Feb 13, 2024
1 parent 79869e4 commit 6a49bb9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/current/v22.2/performance-best-practices-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,19 @@ If you have long-running queries (such as analytics queries that perform full ta

However, because `AS OF SYSTEM TIME` returns historical data, your reads might be stale.

### Disallow full table scans with the `disallow_full_table_scans` setting

To prevent overloading production clusters with [full table scans]({% link {{ page.version.version }}/ui-sql-dashboard.md %}#full-table-index-scans), you have several options:

1. At the cluster level, configure the `disallow_full_table_scans` [session setting]({% link {{page.version.version}}/set-vars.md %}#disallow-full-table-scans) for some or all users/roles using the [`ALTER ROLE`]({% link {{ page.version.version }}/alter-role.md %}) statement.

{% include_cached copy-clipboard.html %}
~~~ sql
ALTER ROLE ALL SET disallow_full_table_scans = true;
~~~

1. At the application level, add the `disallow_full_table_scans` [session setting]({% link {{page.version.version}}/set-vars.md %}#disallow-full-table-scans) to the connection string using the [`options` parameter]({% link {{page.version.version}}/connection-parameters.md %}#additional-connection-parameters).

## Hot spots

A *hot spot* is any location on the cluster receiving significantly more requests than another. Hot spots can cause problems as requests increase.
Expand Down
13 changes: 13 additions & 0 deletions src/current/v23.1/performance-best-practices-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,19 @@ If you have long-running queries (such as analytics queries that perform full ta

However, because `AS OF SYSTEM TIME` returns historical data, your reads might be stale.

### Disallow full table scans with the `disallow_full_table_scans` setting

To prevent overloading production clusters with [full table scans]({% link {{ page.version.version }}/ui-sql-dashboard.md %}#full-table-index-scans), you have several options:

1. At the cluster level, configure the `disallow_full_table_scans` [session setting]({% link {{page.version.version}}/set-vars.md %}#disallow-full-table-scans) for some or all users/roles using the [`ALTER ROLE`]({% link {{ page.version.version }}/alter-role.md %}) statement.

{% include_cached copy-clipboard.html %}
~~~ sql
ALTER ROLE ALL SET disallow_full_table_scans = true;
~~~

1. At the application level, add the `disallow_full_table_scans` [session setting]({% link {{page.version.version}}/set-vars.md %}#disallow-full-table-scans) to the connection string using the [`options` parameter]({% link {{page.version.version}}/connection-parameters.md %}#additional-connection-parameters).

<a id="understanding-and-avoiding-transaction-contention"></a>

## Transaction contention
Expand Down
13 changes: 13 additions & 0 deletions src/current/v23.2/performance-best-practices-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,19 @@ If you have long-running queries (such as analytics queries that perform full ta

However, because `AS OF SYSTEM TIME` returns historical data, your reads might be stale.

### Disallow full table scans with the `disallow_full_table_scans` setting

To prevent overloading production clusters with [full table scans]({% link {{ page.version.version }}/ui-sql-dashboard.md %}#full-table-index-scans), you have several options:

1. At the cluster level, configure the `disallow_full_table_scans` [session setting]({% link {{page.version.version}}/set-vars.md %}#disallow-full-table-scans) for some or all users/roles using the [`ALTER ROLE`]({% link {{ page.version.version }}/alter-role.md %}) statement.

{% include_cached copy-clipboard.html %}
~~~ sql
ALTER ROLE ALL SET disallow_full_table_scans = true;
~~~

1. At the application level, add the `disallow_full_table_scans` [session setting]({% link {{page.version.version}}/set-vars.md %}#disallow-full-table-scans) to the connection string using the [`options` parameter]({% link {{page.version.version}}/connection-parameters.md %}#additional-connection-parameters).

<a id="understanding-and-avoiding-transaction-contention"></a>

## Transaction contention
Expand Down

0 comments on commit 6a49bb9

Please sign in to comment.