Skip to content
Merged
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
2 changes: 1 addition & 1 deletion modules/guides/pages/cbo.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The following code activates the Cost-Based Optimizer for subsequent requests on
--
====

For more information and examples, refer to xref:settings:query-settings.adoc[Settings and Parameters].
For more information and examples, refer to xref:n1ql:n1ql-manage/query-settings.adoc[].

== Updating Statistics

Expand Down
12 changes: 6 additions & 6 deletions modules/guides/pages/prep-statements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ include::partial$query-context.adoc[tag=step]
.Query
[source,sqlpp]
----
include::settings:example$param-names.n1ql[tag=statement]
include::n1ql:example$settings/param-names.n1ql[tag=statement]
----

To execute this query, the parameters must be supplied by name.
Expand All @@ -55,7 +55,7 @@ include::partial$query-context.adoc[tag=step]
.Query
[source,sqlpp]
----
include::settings:example$param-numbers.n1ql[tag=statement]
include::n1ql:example$settings/param-numbers.n1ql[tag=statement]
----

To execute this query, the parameters must be supplied as a list, in order of the placeholder numbers.
Expand All @@ -70,7 +70,7 @@ include::partial$query-context.adoc[tag=step]
.Query
[source,sqlpp]
----
include::settings:example$param-positions.n1ql[tag=statement]
include::n1ql:example$settings/param-positions.n1ql[tag=statement]
----

To execute this query, the parameters must be supplied as a list, in the order in which the placeholders appear in the statement.
Expand Down Expand Up @@ -117,17 +117,17 @@ The following query supplies positional parameter values, using the cbq shell.

[source,sqlpp]
----
include::settings:example$param-numbers.n1ql[tags=**]
include::n1ql:example$settings/param-numbers.n1ql[tags=**]
----

The following query supplies named parameter values, using the cbq shell.

[source,sqlpp]
----
include::settings:example$param-names.n1ql[tags=**]
include::n1ql:example$settings/param-names.n1ql[tags=**]
----

For more information and examples, refer to xref:settings:query-settings.adoc[Settings and Parameters].
For more information and examples, refer to xref:n1ql:n1ql-manage/query-settings.adoc[].
--

.NET::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
:install-sample-buckets: xref:manage:manage-settings/install-sample-buckets.adoc
:query: xref:n1ql:query.adoc
:query-preferences: xref:tools:query-workbench.adoc#query-preferences
:scan_consistency: xref:settings:query-settings.adoc#scan_consistency
:scan_consistency: xref:n1ql:n1ql-manage/query-settings.adoc#scan_consistency

[abstract]
The _Index Service_ ensures availability and performance through _replication_ and _partitioning_.
Expand Down
38 changes: 38 additions & 0 deletions modules/n1ql/examples/settings/node-level-settings.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"atrcollection": "",
"auto-prepare": false,
"cleanupclientattempts": true,
"cleanuplostattempts": true,
"cleanupwindow": "1m0s",
"completed": {
"aborted": null,
"threshold": 1000
},
"completed-limit": 4000,
"completed-threshold": 1000,
"controls": false,
"cpuprofile": "",
"debug": false,
"functions-limit": 16384,
"keep-alive-length": 16384,
"loglevel": "INFO",
"max-index-api": 4,
"max-parallelism": 1,
"memory-quota": 0,
"memprofile": "",
"mutexprofile": false,
"n1ql-feat-ctrl": 76,
"numatrs": 1024,
"pipeline-batch": 16,
"pipeline-cap": 512,
"plus-servicers": 16,
"prepared-limit": 16384,
"pretty": false,
"profile": "off",
"request-size-cap": 67108864,
"scan-cap": 512,
"servicers": 4,
"timeout": 0,
"txtimeout": "0s",
"use-cbo": true
}
5 changes: 5 additions & 0 deletions modules/n1ql/examples/settings/node-level-settings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

# tag::curl[]
curl http://localhost:8093/admin/settings -u user:pword
# end::curl[]
9 changes: 9 additions & 0 deletions modules/n1ql/examples/settings/param-names.n1ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* tag::arguments[] */
\SET -@country "France";
\SET -$altitude 500;
/* end::arguments[] */

/* tag::statement[] */
SELECT COUNT(*) FROM airport
WHERE country = $country AND geo.alt > @altitude;
/* end::statement[] */
8 changes: 8 additions & 0 deletions modules/n1ql/examples/settings/param-numbers.n1ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* tag::arguments[] */
\SET -args ["France", 500];
/* end::arguments[] */

/* tag::statement[] */
SELECT COUNT(*) FROM airport
WHERE country = $1 AND geo.alt > @2;
/* end::statement[] */
8 changes: 8 additions & 0 deletions modules/n1ql/examples/settings/param-positions.n1ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* tag::arguments[] */
\SET -args ["France", 500];
/* end::arguments[] */

/* tag::statement[] */
SELECT COUNT(*) FROM airport
WHERE country = ? AND geo.alt > ?;
/* end::statement[] */
5 changes: 5 additions & 0 deletions modules/n1ql/examples/settings/save-node-level-settings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

# tag::curl[]
curl http://localhost:8093/admin/settings -u user:pword -o ./query_settings.json
# end::curl[]
2 changes: 1 addition & 1 deletion modules/n1ql/pages/n1ql-intro/cbq.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ $ ./cbq -e http://localhost:8091 -qc "travel-sample.inventory"
`--timeout`
| string (duration)
a| Sets the query timeout parameter.
For more information, see xref:settings:query-settings.adoc#timeout_req[timeout].
For more information, see xref:n1ql:n1ql-manage/query-settings.adoc#timeout_req[timeout].

Shell command: <<cbq-set,\SET>> `-timeout`

Expand Down
4 changes: 2 additions & 2 deletions modules/n1ql/pages/n1ql-intro/queriesandresults.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ When the query context is not set, it defaults to the `default` namespace, with

* To set the query context in the Query Workbench, use the the xref:tools:query-workbench.adoc#query-context[query context] drop-down menu in the Query Editor.

* To set the query context from the cbq shell or the REST API, use the xref:settings:query-settings.adoc#query_context[query_context] request-level parameter.
* To set the query context from the cbq shell or the REST API, use the xref:n1ql:n1ql-manage/query-settings.adoc#query_context[query_context] request-level parameter.

.Tenant separation
[IMPORTANT]
Expand Down Expand Up @@ -148,7 +148,7 @@ This is particularly useful when there are many query parameters, and ensuring t

To set query parameter values when you run the query, use the cbq query shell, the Query tab, or the {sqlpp} REST API.

For more information and examples, refer to xref:settings:query-settings.adoc#section_srh_tlm_n1b[Named Parameters and Positional Parameters].
For more information and examples, refer to xref:n1ql:n1ql-manage/query-settings.adoc#section_srh_tlm_n1b[Named Parameters and Positional Parameters].

[#prepare-stmts]
== Query Optimization Using Prepared Statements
Expand Down
2 changes: 1 addition & 1 deletion modules/n1ql/pages/n1ql-language-reference/advisor.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:sys-tasks-cache: {monitor}#sys-tasks-cache

:index-advisor: xref:tools:query-workbench.adoc#index-advisor
:completed-limit: xref:settings:query-settings.adoc#completed-limit
:completed-limit: xref:n1ql:n1ql-manage/query-settings.adoc#completed-limit

{description}
There are two main scenarios for using this function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
:execute: xref:n1ql:n1ql-language-reference/execute.adoc
:transactions: xref:n1ql:n1ql-language-reference/transactions.adoc
:preparation: xref:n1ql:n1ql-language-reference/transactions.adoc#preparation
:tximplicit: xref:settings:query-settings.adoc#tximplicit
:txid: xref:settings:query-settings.adoc#txid
:tximplicit: xref:n1ql:n1ql-manage/query-settings.adoc#tximplicit
:txid: xref:n1ql:n1ql-manage/query-settings.adoc#txid

// Related links
:overview: xref:learn:data/transactions.adoc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Cross-references
:durability: xref:learn:data/durability.adoc
:edit-bucket: xref:manage:manage-buckets/edit-bucket.adoc
:durability_level: xref:settings:query-settings.adoc#durability_level
:durability_level: xref:n1ql:n1ql-manage/query-settings.adoc#durability_level
:transactions: xref:n1ql:n1ql-language-reference/transactions.adoc
:preparation: xref:n1ql:n1ql-language-reference/transactions.adoc#preparation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:description: The cost-based optimizer takes into account the cost of memory, CPU, network transport, and disk usage when choosing the optimal plan to execute a query.

// Cross-references
:query-settings: xref:settings:query-settings.adoc
:query-settings: xref:n1ql:n1ql-manage/query-settings.adoc
:queryUseCBO: {query-settings}#queryUseCBO
:use-cbo-srv: {query-settings}#use-cbo-srv
:use_cbo_req: {query-settings}#use_cbo_req
Expand Down
2 changes: 1 addition & 1 deletion modules/n1ql/pages/n1ql-language-reference/curl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ FROM CURL("http://Administrator:password@127.0.0.1:8094/api/index/fts_index/quer
The following example uses the `CURL()` function with a WHERE clause.
It uses the Yahoo finance API to find the day's low value (i.e `DaysLow`) of HDP stock and finds all the documents in the `users` keyspace that have `min_threshold` attribute value greater than the DaysLow stock value.

For this example, unset the query context using the xref:tools/query-workbench.adoc#query-context[query context] drop-down menu in the Query Workbench, or the xref:settings:query-settings.adoc#query_context[query_context] request-level parameter.
include::ROOT:partial$query-context.adoc[tag=unset]

// TODO: completely overhaul this to use `travel-sample`.tenant_agent_00.users

Expand Down
2 changes: 1 addition & 1 deletion modules/n1ql/pages/n1ql-language-reference/execute.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ include::example$utility/execute-numbers.n1ql[]
====
Alternatively, you can specify named parameters and positional parameters using the {sqlpp} REST API (`/query/service` endpoint), the `cbq` command line tool, or a software development kit (SDK).
Named parameters can be specified as request-level parameters, and positional parameters can be specified using the `args` parameter.
Refer to xref:settings:query-settings.adoc[Query Settings] for more information.
See xref:n1ql:n1ql-manage/query-settings.adoc[] for more information.

When you specify parameters with the USING clause, you cannot also specify parameters at the same time using the {sqlpp} REST API, the `cbq` command line tool, or an SDK.
When you do this, the query service returns error `5003`: "cannot have both USING clause and request parameters".
Expand Down
4 changes: 2 additions & 2 deletions modules/n1ql/pages/n1ql-language-reference/flex-indexes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:isstring: xref:n1ql-language-reference/typefun.adoc#isstring
:isnumber: xref:n1ql-language-reference/typefun.adoc#isnumber
:covering-indexes: xref:n1ql:n1ql-language-reference/covering-indexes.adoc
:query-settings: xref:settings:query-settings.adoc
:query-settings: xref:n1ql:n1ql-manage/query-settings.adoc
:fts-creating-indexes: xref:fts:fts-creating-indexes.adoc
:inserting-a-child-field: xref:fts:fts-creating-indexes.adoc#inserting-a-child-field
:pre-constructed-analyzers: xref:fts:fts-using-analyzers.adoc#pre-constructed-analyzers
Expand Down Expand Up @@ -98,7 +98,7 @@ Assuming that there is no search function in the query predicate, there are two
For full details, refer to {index-type}[USE Clause].

* Set the `use_fts` request-level parameter to `true`.
For full details, refer to {query-settings}[Settings and Parameters].
For full details, refer to {query-settings}[].

When using an index hint, you may specify preferred indexes by name, or simply specify the preferred index type -- `FTS` or `GSI`.
It is possible to specify mixed index types.
Expand Down
2 changes: 1 addition & 1 deletion modules/n1ql/pages/n1ql-language-reference/insert.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
:from-keyspace-ref: {from}#from-keyspace-ref
:as-clause: {from}#section_ax5_2nx_1db

:query-settings: xref:settings:query-settings.adoc
:query-settings: xref:n1ql:n1ql-manage/query-settings.adoc
:pipeline_batch_req: {query-settings}#pipeline_batch_req
:pipeline-batch-srv: {query-settings}#pipeline-batch-srv
:max_parallelism_req: {query-settings}#max_parallelism_req
Expand Down
4 changes: 2 additions & 2 deletions modules/n1ql/pages/n1ql-language-reference/merge.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

:authorization-overview: xref:learn:security/authorization-overview.adoc
:bucket-expiration: xref:learn:data/expiration.adoc
:preserve_expiration: xref:settings:query-settings.adoc#preserve_expiration
:preserve_expiry: xref:n1ql:n1ql-manage/query-settings.adoc#preserve_expiry
:logical-hierarchy: xref:n1ql-intro/sysinfo.adoc#logical-hierarchy
:selectclause: xref:n1ql-language-reference/selectclause.adoc
:subqueries: xref:n1ql-language-reference/subqueries.adoc
Expand Down Expand Up @@ -746,7 +746,7 @@ If the airport does not exist in the `airport` keyspace, a new record is created
include::example$dml/ansi-merge-expire.n1ql[]
----

Note that it is possible to preserve the document expiration using the request-level {preserve_expiration}[preserve_expiration] parameter.
Note that it is possible to preserve the document expiration using the request-level {preserve_expiry}[preserve_expiry] parameter.
====

.Lookup merge with expression source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,11 @@ Connecting with this user may not be possible.`
| `Request has exceeded memory quota`
a| The query request exceeded the set Query Memory Quota.

You can set a memory quota with the Couchbase Server UI, the REST API, or the CLI. For more information, see xref:settings:query-settings.adoc[Query Settings and Parameters].
You can set a memory quota with the Couchbase Server UI, the REST API, or the CLI.
For more information, see xref:n1ql:n1ql-manage/query-settings.adoc[].

* To set a memory quota with the UI, see xref:manage:manage-settings/general-settings.adoc#query-settings[Query Settings] in the General settings for Couchbase Server.
* To set a memory quota with the REST API, see xref:settings:query-settings.adoc#queryMemoryQuota[queryMemoryQuota] in Query Settings and Parameters.
* To set a memory quota with the REST API, see the cluster-level xref:n1ql:n1ql-manage/query-settings.adoc#queryMemoryQuota[queryMemoryQuota] setting.
* To set a memory quota with the CLI, see xref:cli:cbcli/couchbase-cli-setting-query.adoc[setting-query] in the CLI Reference.
|===

Expand Down
4 changes: 2 additions & 2 deletions modules/n1ql/pages/n1ql-language-reference/prepare.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ The process is similar to creating a prepared statement without a local name:

The auto-prepare feature is inactive by default.
You can turn the auto-prepare feature on or off using the `auto-prepare` service-level query setting.
For more details, refer to xref:settings:query-settings.adoc#auto-prepare[Query Settings].
For more details, refer to xref:n1ql:n1ql-manage/query-settings.adoc#auto-prepare[].

Auto-prepare is disabled for {sqlpp} requests which contain parameters, if they do not use the PREPARE statement.

Expand All @@ -214,7 +214,7 @@ You can use this when you need to execute the prepared statement again.

The auto-execute feature is inactive by default.
You can turn the auto-execute feature on or off using the `auto_execute` request-level query setting.
For more details, refer to xref:settings:query-settings.adoc#auto_execute[Query Settings].
For more details, refer to xref:n1ql:n1ql-manage/query-settings.adoc#auto_execute[].

The auto-execute feature only works for {sqlpp} requests which actually contain the PREPARE statement.
Prepared statements created by the <<auto-prepare,auto-prepare>> feature are not executed by the auto-execute feature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
:import-documents: xref:manage:import-documents/import-documents.adoc
:bucket-expiration: xref:learn:data/expiration.adoc
:document-expiration: xref:java-sdk:howtos:kv-operations.adoc#document-expiration
:preserve_expiration: xref:settings:query-settings.adoc#preserve_expiration
:preserve_expiration: xref:n1ql:n1ql-manage/query-settings.adoc#preserve_expiration
:n1ql-language-reference: xref:n1ql-language-reference
:update: {n1ql-language-reference}/update.adoc
:insert: {n1ql-language-reference}/insert.adoc
Expand Down
42 changes: 21 additions & 21 deletions modules/n1ql/pages/n1ql-language-reference/transactions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,27 @@
:n1ql-rest-api: xref:n1ql:n1ql-rest-api/index.adoc

// Settings cross-references
:txid: xref:settings:query-settings.adoc#txid
:tximplicit: xref:settings:query-settings.adoc#tximplicit
:txstmtnum: xref:settings:query-settings.adoc#txstmtnum
:kvtimeout: xref:settings:query-settings.adoc#kvtimeout
:txtimeout_req: xref:settings:query-settings.adoc#txtimeout_req
:txtimeout-srv: xref:settings:query-settings.adoc#txtimeout-srv
:queryTxTimeout: xref:settings:query-settings.adoc#queryTxTimeout
:atrcollection_req: xref:settings:query-settings.adoc#atrcollection_req
:atrcollection-srv: xref:settings:query-settings.adoc#atrcollection-srv
:cleanupclientattempts: xref:settings:query-settings.adoc#cleanupclientattempts
:cleanuplostattempts: xref:settings:query-settings.adoc#cleanuplostattempts
:cleanupwindow: xref:settings:query-settings.adoc#cleanupwindow
:queryCleanupClientAttempts: xref:settings:query-settings.adoc#queryCleanupClientAttempts
:queryCleanupLostAttempts: xref:settings:query-settings.adoc#queryCleanupLostAttempts
:queryCleanupWindow: xref:settings:query-settings.adoc#queryCleanupWindow
:numatrs_req: xref:settings:query-settings.adoc#numatrs_req
:numatrs-srv: xref:settings:query-settings.adoc#numatrs-srv
:queryNumAtrs: xref:settings:query-settings.adoc#queryNumAtrs
:scan_consistency: xref:settings:query-settings.adoc#scan_consistency
:durability_level: xref:settings:query-settings.adoc#durability_level
:transactional-scan-consistency: xref:settings:query-settings.adoc#transactional-scan-consistency
:txid: xref:n1ql:n1ql-manage/query-settings.adoc#txid
:tximplicit: xref:n1ql:n1ql-manage/query-settings.adoc#tximplicit
:txstmtnum: xref:n1ql:n1ql-manage/query-settings.adoc#txstmtnum
:kvtimeout: xref:n1ql:n1ql-manage/query-settings.adoc#kvtimeout
:txtimeout_req: xref:n1ql:n1ql-manage/query-settings.adoc#txtimeout_req
:txtimeout-srv: xref:n1ql:n1ql-manage/query-settings.adoc#txtimeout-srv
:queryTxTimeout: xref:n1ql:n1ql-manage/query-settings.adoc#queryTxTimeout
:atrcollection_req: xref:n1ql:n1ql-manage/query-settings.adoc#atrcollection_req
:atrcollection-srv: xref:n1ql:n1ql-manage/query-settings.adoc#atrcollection-srv
:cleanupclientattempts: xref:n1ql:n1ql-manage/query-settings.adoc#cleanupclientattempts
:cleanuplostattempts: xref:n1ql:n1ql-manage/query-settings.adoc#cleanuplostattempts
:cleanupwindow: xref:n1ql:n1ql-manage/query-settings.adoc#cleanupwindow
:queryCleanupClientAttempts: xref:n1ql:n1ql-manage/query-settings.adoc#queryCleanupClientAttempts
:queryCleanupLostAttempts: xref:n1ql:n1ql-manage/query-settings.adoc#queryCleanupLostAttempts
:queryCleanupWindow: xref:n1ql:n1ql-manage/query-settings.adoc#queryCleanupWindow
:numatrs_req: xref:n1ql:n1ql-manage/query-settings.adoc#numatrs_req
:numatrs-srv: xref:n1ql:n1ql-manage/query-settings.adoc#numatrs-srv
:queryNumAtrs: xref:n1ql:n1ql-manage/query-settings.adoc#queryNumAtrs
:scan_consistency: xref:n1ql:n1ql-manage/query-settings.adoc#scan_consistency
:durability_level: xref:n1ql:n1ql-manage/query-settings.adoc#durability_level
:transactional-scan-consistency: xref:n1ql:n1ql-manage/query-settings.adoc#transactional-scan-consistency

// Related links
:begin-transaction: xref:n1ql-language-reference/begin-transaction.adoc
Expand Down
Loading