diff --git a/doc/src/sgml/pgcollectadvice.sgml b/doc/src/sgml/pgcollectadvice.sgml
index fd7d879d816..ba2837c3982 100644
--- a/doc/src/sgml/pgcollectadvice.sgml
+++ b/doc/src/sgml/pgcollectadvice.sgml
@@ -11,11 +11,16 @@
The pg_collect_advice extension allows you to
automatically generate plan advice each time a query is planned and store
the query and the generated advice string either in local or shared memory.
+ Collection enablement and entries are described below, but importantly,
+ there is no deduplication involved; each planning event produces one entry,
+ and a mandatory cap on the number of entries allowed must be set before
+ enabling collection.
Note that this extension requires the module,
- which performs the actual plan advice generation; this module only knows
- how to store the generated advice for later examination. Whenever
- pg_collect_advice is loaded, it will automatically load
- pg_plan_advice.
+ which performs the actual plan advice generation; this module just handles
+ enabling automatic generation and performing the storage of the generated
+ advice for later examination through the extension's views.
+ Whenever pg_collect_advice is loaded, it will automatically
+ load pg_plan_advice.
@@ -30,12 +35,14 @@
- pg_collect_advice includes both a shared advice
- collector and a local advice collector. The local advice collector makes
- queries and their advice strings visible only to the session where those
- queries were planned, while the shared advice collector collects data
- on a system-wide basis, and authorized users can examine data from all
- sessions.
+ pg_collect_advice includes both a local advice
+ collector and a shared advice collector.
+ The local advice collector stores entries locally to the session where those
+ queries were planned and requires the extension to be installed within the
+ database the session is connected to.
+ The shared advice collector stores entries for all databases in the cluster,
+ and authorized users can examine entries from any session connected to a
+ database where the extension is installed.
@@ -67,14 +74,26 @@
- In addition to the query texts and advice strings, the advice collectors
- will also store the OID of the role that caused the query to be planned,
+ For each entry in a collector, in addition to the query texts and advice
+ strings, the advice collector will also store the OID of the role that caused the query to be planned,
the OID of the database in which the query was planned, the query ID,
and the time at which the collection occurred. This module does not
automatically enable query ID computation; therefore, if you want the
- query ID value to be populated in collected advice, be sure to configure
- compute_query_id = on. Otherwise, the query ID may
- always show as 0.
+ query ID value to be populated in collected advice, be sure the setting
+ compute_query_id is set to on,
+ otherwise the query ID will appear as 0.
+
+
+
+ The pg_plan_advice module also produces feedback; the collector
+ is unable to capture such feedback as it relies on running explain
+ with PLAN_ADVICE which does not happen during normal execution.
+
+
+
+ Plan advice is not a substitute for seeing a query plan. The auto_explain
+ module can be used (imprecisely) in conjunction with this module to add explain
+ output to the corpus of planner data automatically captured for executed queries.
@@ -92,8 +111,7 @@
- Removes all collected query texts and advice strings from backend-local
- memory.
+ Removes all collected entries from backend-local memory.
@@ -110,8 +128,7 @@
- Returns all query texts and advice strings stored in the local
- advice collector.
+ Returns all entries stored in the local advice collector.
@@ -126,8 +143,7 @@
- Removes all collected query texts and advice strings from shared
- memory.
+ Removes all collected entires from shared memory.
@@ -144,8 +160,7 @@
- Returns all query texts and advice strings stored in the shared
- advice collector.
+ Returns all entries stored in the shared advice collector.
@@ -170,7 +185,7 @@
pg_collect_advice.local_collector enables the
- local advice collector. The default value is false.
+ local advice collector. The default value is false.
@@ -186,8 +201,8 @@
pg_collect_advice.local_collection_limit sets the
- maximum number of query texts and advice strings retained by the
- local advice collector. The default value is 0.
+ maximum number of entries retained by the local advice collector.
+ The default value is 0.
@@ -203,7 +218,7 @@
pg_collect_advice.shared_collector enables the
- shared advice collector. The default value is false.
+ shared advice collector. The default value is false.
Only superusers and users with the appropriate SET
privilege can change this setting.
@@ -221,8 +236,8 @@
pg_collect_advice.shared_collection_limit sets the
- maximum number of query texts and advice strings retained by the
- shared advice collector. The default value is 0.
+ maximum number of entries retained by the shared advice collector.
+ The default value is 0.
Only superusers and users with the appropriate SET
privilege can change this setting.