Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ include::third-party:partial$nav.adoc[]
* xref:manage:manage-logging/manage-logging.adoc[Manage Logging]
* xref:manage:manage-settings/manage-settings.adoc[Manage Settings]
** xref:manage:manage-settings/general-settings.adoc[General]
** xref:manage:manage-settings/query-ui-settings.adoc[Query]
** xref:manage:manage-settings/configure-compact-settings.adoc[Auto-Compaction]
** xref:manage:manage-settings/configure-alerts.adoc[Alerts]
** xref:manage:manage-settings/install-sample-buckets.adoc[Sample Buckets]
Expand Down
188 changes: 188 additions & 0 deletions modules/manage/pages/manage-settings/query-ui-settings.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
= Query
:description: Configure Query Service settings to manage CURL() access, disk and memory quotas, logging, and optimizer settings.

[abstract]
{description}

== Overview

You can configure the Query Service for your cluster using the menu:Settings[] tab on the Couchbase Server Web Console.

Use these settings to control CURL() endpoint access, set temporary disk usage limits, manage resources, and set query execution and logging parameters.

To configure the Query Service settings:

. In the Couchbase Server Web Console, click menu:Settings[].
. Select the *Query* tab.
. Update the required settings and click btn:[Save].

== CURL Function Access

The `CURL()` function allows {sqlpp} queries to send HTTP requests to external endpoints.

[cols="1,2,1",options="header"]
|===
| Setting | Description | Default Value

| *CURL() Function Access*
a| Controls whether `CURL()` can access any external URL or only specified URLs.

Select 1 of the following options:

* *Restricted*: Limits access to only the URLs listed in *Allowed CURL URLs*.
* *Unrestricted*: Allows access to any URL.
| Unrestricted

| *Allowed CURL URLs*
a| The URLs `CURL()` can access when *CURL() Function Access* is set to *Restricted*.

* To add a URL, click btn:[+].
You can add multiple URLs.
* To remove a URL, click btn:[-] next to it.
| None

| *Disallowed CURL URLs*
a| The URLs `CURL()` can never access, regardless of the *CURL() Function Access* setting.

* To add a URL, click btn:[+].
You can add multiple URLs.
* To remove a URL, click btn:[-] next to it.
| None
|===

== Temporary Disk Usage

When an index scan returns more data than fits in memory, the indexer writes the remaining data to temporary backfill files on disk.

[cols="1,2,1",options="header"]
|===
| Setting | Description | Default Value

| *Query Temp Disk Path*
| The absolute path where the indexer writes temporary backfill files.
The path must already exist on the target node.
|`/opt/couchbase/var/lib/couchbase/tmp`

| *Quota*
a| The maximum size, in mebibytes (MiB), allowed for temporary backfill files.

* To turn off backfill, set the value to `0`.
* To allow unlimited backfill, up to the maximum available disk space, set the value to `-1`.
|`5120`

|===

NOTE: Global Secondary Indexes (GSIs) do not perform backfill operations if *Quota* is set to `0` or lower.
To enable backfill for GSIs, set *Quota* to a large positive value (such as `102400`).

== Resource Limits

Configure parameters to manage memory, execution limits, and query timeouts.

[cols="1,2,1",options="header"]
|===
| Setting | Description | Default Value

| *Pipeline Batch*
| Number of items the Query Service batches together when fetching data from the Data Service.
| `16`

| *Pipeline Cap*
| Maximum number of items the Query Service buffers during a single fetch.
| `512`

| *Scan Cap*
| Maximum size, in items, of the buffered channel between the indexer client and the Query Service during an index scan.
| `512`

| *Timeout (ns)*
| Maximum request execution time in nanoseconds before timing out.

To turn off timeouts, set the value to `0`.
| `0`

| *Prepared Limit*
| Maximum number of prepared statements retained in the Query Service cache.
| `16384`

| *Max Parallelism*
| Maximum number of index partitions the Query Service uses for parallel aggregation.
| `1`

| *N1QL Feature Controller*
| Bitmask value used to enable or disable specific query engine features and controls.

WARNING: Do not change *N1QL Feature Controller* without guidance from Couchbase technical support.
| `76`

| *Transaction Timeout (duration)*::
| Maximum duration (in milliseconds) allowed for a transaction before timing out.
| `0ms`

| *Memory Quota (MB)*
| Maximum amount of memory (in megabytes) allocated to processing a query.
| `0`
|===

== Logging and Completed Requests

The Query Service maintains a log of completed requests.
Use the following options to control query logging.

[cols="1,2,1",options="header"]
|===
| Setting | Description | Default Value

| *Completed Limit*
| Maximum number of requests retained in the completed requests catalog.
| `4000`

| *Completed Threshold*
| Minimum query duration (in milliseconds) required for a completed request to be logged.
The Query Service omits queries that finish faster than this threshold.
| `1000`

| *Log Level*
| The logging level for the Query Service logger.
| `Info`
|===

== Replica Usage

Configure read options for high availability and failover scenarios.

[cols="1,2,1",options="header"]
|===
| Setting | Description | Default Value

| *Use Replica*
a| Controls whether queries can fall back to reading data from replica buckets when the active bucket is unavailable.

* *Unset*: Read from replica is controlled at the request level.
* *On*: Read from replica is enabled for all queries, but a request can still turn it off.
* *Off*: Read from replica is turned off for all queries and cannot be overridden at the request level.
|`Unset`
|===

NOTE: Do not enable *Use Replica* if your workload requires consistent results.
Only `SELECT` outside of a transaction can read from a replica.
In addition, KV range scans cannot start on a replica vBucket.
If a query uses a sequential scan and a data node becomes unavailable, the query might return an error even when read from replica is enabled.

== Query Optimization

Configure rules for cost optimizer behavior and replica usage.

[cols="1,2,1",options="header"]
|===
| Setting | Description | Default Value

| *Use Cost-Based Optimizer*
a| Determines whether to use the xref:n1ql:n1ql-language-reference/cost-based-optimizer.adoc[cost-based optimizer] for execution planning.

* To enable the optimizer, select *Use Cost-Based Optimizer*.
* To disable the optimizer, clear *Use Cost-Based Optimizer*.

| Selected (Enabled)
|===