From b117974763bc77133602535ff5232eed5ec9ceb0 Mon Sep 17 00:00:00 2001 From: Rakhi Prathap Date: Tue, 25 Aug 2026 10:51:36 +0530 Subject: [PATCH 1/6] Add Plan stability Settings --- .../manage-settings/query-ui-settings.adoc | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/modules/manage/pages/manage-settings/query-ui-settings.adoc b/modules/manage/pages/manage-settings/query-ui-settings.adoc index 450e2a9fa1..380d829dd8 100644 --- a/modules/manage/pages/manage-settings/query-ui-settings.adoc +++ b/modules/manage/pages/manage-settings/query-ui-settings.adoc @@ -190,6 +190,41 @@ a| Determines whether to use the xref:n1ql:n1ql-language-reference/cost-based-op | Selected (Enabled) |=== +== Plan Stability + +Configure settings for xref:n1ql:n1ql-manage/query-plan-stability.adoc[Query Plan Stability]. + +[cols="1,2,1",options="header"] +|=== +| Setting | Description | Default Value + +| *Plan Stability* + +a| Controls whether to save query execution plans to disk. + +* *Off*: Does not save execution plans to disk. +Prepared statements remain in memory only and are cleared if the query node restart or upgrades. +* *On Prepared Statements*: Automatically saves execution plans to disk for all `PREPARE` statements. +* *On All Statements*: Automatically saves execution plans to disk for all queries, including `PREPARE` statements and ad-hoc queries. + +| *Off* + +| *Plan Stability Error Policy* + +a| Determines how the Query Service behaves when a saved plan is unavailable. + +* *Strict*: Stops execution and returns the error to the application. +* *Moderate*: Generates a new plan to execute the statement, but keeps the original saved plan. +* *Flexible*: Generates a new plan to execute the statement and overwrites the saved plan with the new one. +This setting is greyed out if *Plan Stability* is set to *Off*. + +For more information, see xref:n1ql:n1ql-manage/query-plan-stability.adoc#error-policies[]. + +| *Moderate* + +Unavailable if *Plan Stability* is *Off*. +|=== + == Query Settings via CLI You can set all of the cluster-level query settings, except for the CURL access control settings, using the xref:cli:cbcli/couchbase-cli-setting-query.adoc[setting-query] command. From f1833936c0a4270bf2abfe1fd8873d653b09de47 Mon Sep 17 00:00:00 2001 From: Rakhi Prathap Date: Tue, 25 Aug 2026 14:57:24 +0530 Subject: [PATCH 2/6] Updates --- .../pages/manage-settings/query-ui-settings.adoc | 12 ++++++------ preview/DOC-14217-add-plan-stability-settings.yml | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 preview/DOC-14217-add-plan-stability-settings.yml diff --git a/modules/manage/pages/manage-settings/query-ui-settings.adoc b/modules/manage/pages/manage-settings/query-ui-settings.adoc index 380d829dd8..9c7fcf2701 100644 --- a/modules/manage/pages/manage-settings/query-ui-settings.adoc +++ b/modules/manage/pages/manage-settings/query-ui-settings.adoc @@ -175,7 +175,7 @@ If a query uses a sequential scan and a data node becomes unavailable, the query == Query Optimization -Configure rules for cost optimizer behavior and replica usage. +Configure rules for cost optimizer behavior. [cols="1,2,1",options="header"] |=== @@ -192,7 +192,7 @@ a| Determines whether to use the xref:n1ql:n1ql-language-reference/cost-based-op == Plan Stability -Configure settings for xref:n1ql:n1ql-manage/query-plan-stability.adoc[Query Plan Stability]. +Configure settings for xref:n1ql:n1ql-manage/query-plan-stability.adoc[Query Plan Stability]. [cols="1,2,1",options="header"] |=== @@ -203,11 +203,10 @@ Configure settings for xref:n1ql:n1ql-manage/query-plan-stability.adoc[Query Pla a| Controls whether to save query execution plans to disk. * *Off*: Does not save execution plans to disk. -Prepared statements remain in memory only and are cleared if the query node restart or upgrades. -* *On Prepared Statements*: Automatically saves execution plans to disk for all `PREPARE` statements. -* *On All Statements*: Automatically saves execution plans to disk for all queries, including `PREPARE` statements and ad-hoc queries. +* *On Prepared Statements*: Automatically saves execution plans to disk for all prepared statements. +* *On All Statements*: Automatically saves execution plans to disk for all queries, including prepared statements and ad-hoc queries. -| *Off* +| Off | *Plan Stability Error Policy* @@ -216,6 +215,7 @@ a| Determines how the Query Service behaves when a saved plan is unavailable. * *Strict*: Stops execution and returns the error to the application. * *Moderate*: Generates a new plan to execute the statement, but keeps the original saved plan. * *Flexible*: Generates a new plan to execute the statement and overwrites the saved plan with the new one. + This setting is greyed out if *Plan Stability* is set to *Off*. For more information, see xref:n1ql:n1ql-manage/query-plan-stability.adoc#error-policies[]. diff --git a/preview/DOC-14217-add-plan-stability-settings.yml b/preview/DOC-14217-add-plan-stability-settings.yml new file mode 100644 index 0000000000..1598b75147 --- /dev/null +++ b/preview/DOC-14217-add-plan-stability-settings.yml @@ -0,0 +1,5 @@ +sources: + docs-devex: + branches: [DOC-14217-query-plan-stability, release/8.5] + + From d895207426efd4097e35f5a4fb4a941f3a39217f Mon Sep 17 00:00:00 2001 From: Rakhi Prathap Date: Tue, 25 Aug 2026 15:21:40 +0530 Subject: [PATCH 3/6] Updates --- preview/DOC-14217-add-plan-stability-settings.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/preview/DOC-14217-add-plan-stability-settings.yml b/preview/DOC-14217-add-plan-stability-settings.yml index 1598b75147..b91e7a2023 100644 --- a/preview/DOC-14217-add-plan-stability-settings.yml +++ b/preview/DOC-14217-add-plan-stability-settings.yml @@ -1,5 +1,7 @@ sources: docs-devex: - branches: [DOC-14217-query-plan-stability, release/8.5] + branches: DOC-14217-query-plan-stability +override: + startPage: server:introduction:intro.adoc From 0a1f2c1efcd3b45b62a6833fdb4f75799ce1e72b Mon Sep 17 00:00:00 2001 From: Rakhi Prathap Date: Tue, 25 Aug 2026 15:30:52 +0530 Subject: [PATCH 4/6] Updates --- modules/manage/pages/manage-settings/query-ui-settings.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/manage/pages/manage-settings/query-ui-settings.adoc b/modules/manage/pages/manage-settings/query-ui-settings.adoc index 9c7fcf2701..fe57ef6162 100644 --- a/modules/manage/pages/manage-settings/query-ui-settings.adoc +++ b/modules/manage/pages/manage-settings/query-ui-settings.adoc @@ -220,9 +220,9 @@ This setting is greyed out if *Plan Stability* is set to *Off*. For more information, see xref:n1ql:n1ql-manage/query-plan-stability.adoc#error-policies[]. -| *Moderate* +| Moderate -Unavailable if *Plan Stability* is *Off*. +Unavailable if Plan Stability is Off |=== == Query Settings via CLI From 1e0ae7b684c968a6396d47da5dee34c2e99831d8 Mon Sep 17 00:00:00 2001 From: Rakhi Prathap Date: Tue, 25 Aug 2026 15:37:55 +0530 Subject: [PATCH 5/6] Updates --- .../DOC-14217-add-plan-stability-settings.yml | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/preview/DOC-14217-add-plan-stability-settings.yml b/preview/DOC-14217-add-plan-stability-settings.yml index b91e7a2023..afca933d3f 100644 --- a/preview/DOC-14217-add-plan-stability-settings.yml +++ b/preview/DOC-14217-add-plan-stability-settings.yml @@ -1,7 +1,27 @@ sources: docs-devex: branches: DOC-14217-query-plan-stability -override: - startPage: server:introduction:intro.adoc +# docs-analytics: +# branches: release/8.0 + + couchbase-cli: + url: https://github.com/couchbaselabs/couchbase-cli-doc + branches: master + startPaths: docs/ + +# backup: +# branches: master +# startPaths: docs/ + + cb-swagger: + url: https://github.com/couchbaselabs/cb-swagger + branches: release/8.5 + start_path: docs + + # Minimal SDK build +# docs-sdk-common: +# branches: [release/8.0] +# docs-sdk-java: +# branches: [3.11] From df90a7692c4ea8555234bef2507e58abbac3f086 Mon Sep 17 00:00:00 2001 From: Rakhi Prathap Date: Tue, 25 Aug 2026 18:54:24 +0530 Subject: [PATCH 6/6] Updates --- .../manage-settings/query-ui-settings.adoc | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/manage/pages/manage-settings/query-ui-settings.adoc b/modules/manage/pages/manage-settings/query-ui-settings.adoc index fe57ef6162..274272777e 100644 --- a/modules/manage/pages/manage-settings/query-ui-settings.adoc +++ b/modules/manage/pages/manage-settings/query-ui-settings.adoc @@ -191,8 +191,9 @@ a| Determines whether to use the xref:n1ql:n1ql-language-reference/cost-based-op |=== == Plan Stability +[.status]#Couchbase Server 8.5# -Configure settings for xref:n1ql:n1ql-manage/query-plan-stability.adoc[Query Plan Stability]. +Configure the mode and error policy for xref:n1ql:n1ql-manage/query-plan-stability.adoc[Query Plan Stability]. [cols="1,2,1",options="header"] |=== @@ -200,29 +201,29 @@ Configure settings for xref:n1ql:n1ql-manage/query-plan-stability.adoc[Query Pla | *Plan Stability* -a| Controls whether to save query execution plans to disk. +a| Controls whether the Query Service saves execution plans to disk, and for which statement types. -* *Off*: Does not save execution plans to disk. -* *On Prepared Statements*: Automatically saves execution plans to disk for all prepared statements. -* *On All Statements*: Automatically saves execution plans to disk for all queries, including prepared statements and ad-hoc queries. +Select 1 of the following: -| Off +* `Off`: Does not save execution plans to disk. +* `On Prepared Statements`: Saves execution plans to disk for all prepared statements. +* `On All Statements`: Saves execution plans to disk for all queries, including prepared statements and ad-hoc queries. -| *Plan Stability Error Policy* +| `Off` -a| Determines how the Query Service behaves when a saved plan is unavailable. +| *Plan Stability Error Policy* -* *Strict*: Stops execution and returns the error to the application. -* *Moderate*: Generates a new plan to execute the statement, but keeps the original saved plan. -* *Flexible*: Generates a new plan to execute the statement and overwrites the saved plan with the new one. +a| Controls how the Query Service handles a query when a saved plan is unavailable. -This setting is greyed out if *Plan Stability* is set to *Off*. +Select 1 of the following: -For more information, see xref:n1ql:n1ql-manage/query-plan-stability.adoc#error-policies[]. +* `Strict`: Stops execution and returns the error to the application. +* `Moderate`: Generates a new plan to execute the statement, but keeps the original saved plan. +* `Flexible`: Generates a new plan to execute the statement and overwrites the saved plan with the new one. -| Moderate +For more information, see xref:n1ql:n1ql-manage/query-plan-stability.adoc#error-policies[Error Policies]. -Unavailable if Plan Stability is Off +| `Moderate` (Greyed out if *Plan Stability* is `Off`) |=== == Query Settings via CLI