Planned reporting, October 25, 2026. Owner: Tensor9 Cloud Adapter team. PostgreSQL plan capture is under development and is being qualified by operation and backend. This page describes its reporting contract; it does not establish availability in your installed release. Confirm coverage for your exact service, operation, PostgreSQL backend and adapter version before relying on a plan. Ordinary Explain support does not imply SQL-plan support.
EXPLAIN (FORMAT JSON) result in the same private report. You will retrieve it through the dedicated synthetic AWS t9 service, alongside the adapter’s decisions and operation evidence. The application will keep receiving the native service response.
The mental model
Read three kinds of evidence together:
A plan is an estimate produced by the database planner. It does not prove that an operation committed, that a row was returned, or that the native request used that exact plan.
How collection will work
Explain mode, a completed preview returns 409 ExplainedNotPerformed in the service protocol. ExecuteAndExplain preserves the ordinary operation response. Both carry a report receipt when capture is admitted; neither places a query plan inside the service response.
The observer may run before or after the service response. The diagram shows the independent lifetimes, not a required ordering between native execution and planning.
The adapter will use the operation’s actual compiled SQL and encoded parameters, rather than reconstructing a similar query from a log. A separate, authenticated read-only PostgreSQL connection will perform the planning. It must use the same selected database and a matching database identity and session configuration, including relevant row-security, search-path and planner settings. An administrative connection or a different service’s database is not a substitute.
The observer will not execute the native statement again. PostgreSQL’s ANALYZE option runs the statement; plain EXPLAIN plans it. Tensor9 plan collection will not use EXPLAIN ANALYZE, including for writes. See the PostgreSQL EXPLAIN reference.
Planning errors, unavailable capacity and timeouts will affect the diagnostic evidence, rather than replace the native result or retry the native operation. A preview will remain effect-free: its planning path must not perform the proposed write.
A committed-state estimate
The payload’splanningContext will be committed-state-observation. This names a separate observation of committed database state. It does not claim to share the original operation’s transaction snapshot, see its uncommitted changes, or reproduce transaction-local temporary objects and settings.
Even when SQL and parameters match, database statistics, committed data, configuration or the prepared-statement cache can differ from the original execution. Treat this plan as PostgreSQL’s estimate at its recorded observation time. Do not label its estimated rows or costs as actual execution measurements.
If the adapter cannot reproduce the required context safely, the report will say the plan is unavailable or unsupported. It must not silently plan through a more privileged identity or invent a comparable query.
Retrieve the plan through the existing report workflow
Plan collection will use the same request receipt and report ID as the surrounding explanation:- Preserve the native response and its
x-t9-explain-idandx-t9-explain-expires-atheaders. - Call
T9CloudAdapter.GetExplanationon the install’s publishedt9endpoint. Use the original report owner’s IAM credentials, including the original session token when temporary credentials are used, and SigV4 signing servicet9. - Decode the outer AWS JSON response. Its
bodyis a string containing the selected rendering. In JSON format, inspectfactsfor an assertion withtype: "postgres-explain". - If the report is still collecting, retain its revision and poll the same ID with bounded backoff. Never replay a write to wait for a plan.
- Export needed evidence before the owner acknowledges the sealed revision or retention ends.
Read a PostgreSQL plan fact
This illustrative JSON is one fact excerpt, not a complete report or a production measurement. The relation and predicate are example data; actual full plans retain the values PostgreSQL returns. Relation names identify physical PostgreSQL tables and need not match the origin service resource name.
Human and Agent renderings will carry the same complete plan data as JSON. Choosing a format will not change execution, report ownership or evidence scope.
Interpret the example
The example plans anIndex Scan through ddb_example_orders_pkey with the shown index condition. Plan Rows: 1 estimates rows emitted by that node. The costs are planner units, not milliseconds or currency, and a parent’s cost includes its children. A Seq Scan is not automatically a problem; table size and the fraction of rows needed can make it appropriate. PostgreSQL’s plan-reading guide explains these distinctions.
For an investigation:
- Check that the fact belongs to the request, backend and observation time you are investigating.
- Inspect predicates and child nodes, not only the root node name. A small estimate at the root can sit above substantial scan or join work.
- Compare plans only when the statement, parameters and relevant database context are comparable. Preserve both complete reports when comparing revisions or configurations.
- Use native status and independent state observations to establish effects. Use separately approved performance measurements to establish latency or throughput.
Full plans are private customer data
Full PostgreSQL JSON can include relation and index names, predicates and application literals embedded in expressions. The planned output intentionally preserves them for the exact authenticated report owner. It is not an anonymized or automatically sanitized summary. A new assumed-role session does not inherit another session’s report. A Tensor9 account API key, target-cloud credential or general permission to read other reports does not grant access to a plan-bearing report owned by someone else. Separate SQL text, parameter arrays, credentials and raw PostgreSQL error messages will not be additional plan fields. Values can still occur inside the PostgreSQL plan itself. Review and sanitize an exported copy before sending it to support or another person; preserve the original privately when it is needed as evidence.When a plan is missing
An early revision can precede planning completion. After bounded collection, a report may retain an explicit unknown or unavailable observation instead of a plan. Absence alone does not mean no SQL ran, the operation failed, the statement was cheap or an index was used.
The current plan-fact implementation has a 256 KiB encoded payload allowance, with additional whole-report and work budgets. A plan must fit in full or be unavailable; collection will not silently truncate nodes or expressions. Batch operations may therefore include plans for some statements and an explicit omission count for others.
The planned generated connection budgets reserve one observer connection per active backend profile in addition to native request capacity. Shared planner owners and separate backend owners must be counted according to the deployment’s actual composition. This reservation does not authorize raising a PostgreSQL role limit or changing a live database automatically.
An operation that uses a non-SQL target has no PostgreSQL target plan. A stored-function plan may expose only the function call, rather than SQL executed inside that function. General Explain support, a successful origin request and persistence of the explanation in PostgreSQL do not prove workload SQL-plan coverage.
Common questions
Does a PostgreSQL-backed adapter always include a plan? No. Support is specific to the operation, statement and backend, and this integration is still under development. An operation may reach unsupported SQL or a context that cannot be observed safely. Check the installed release’s coverage and the report’s limitations. Does an INSERT plan mean the row was inserted? No. Planning-only EXPLAIN does not execute the INSERT. AnExecuteAndExplain operation can separately commit its ordinary write; the plan fact alone does not establish that commit.
Will reading the report rerun the query?
No. GetExplanation reads stored evidence. It does not replay the origin operation, execute its SQL or ask PostgreSQL to collect another plan.
Can I recover missing planning evidence by sending the same write again?
Do not replay an uncertain write for diagnostics. Preserve its native result, inspect current resource state using an appropriate read, and use the existing report. A new request is a new operation and requires its own effect and idempotency decision.