-
Notifications
You must be signed in to change notification settings - Fork 479
DOC-15477: Product Change- PR #156905 - sql: Record statement stats for statements executed in UDFs / SPs #21621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
632a5e2
110e5f3
2ab41bb
7455116
04f96eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -32,6 +32,10 @@ The **Statements Fingerprints** view helps you: | |||||
| - View SQL statement fingerprint [details](#statement-fingerprint-page). | ||||||
| - Download SQL statement [diagnostics](#diagnostics) for troubleshooting. | ||||||
|
|
||||||
| {{site.data.alerts.callout_info}} | ||||||
| The **Statements** page displays all SQL statements, including those executed within [user-defined functions]({{ link_prefix}}user-defined-functions.html#statement-statistics) and [stored procedures]({{ link_prefix}}stored-procedures.html#statement-statistics). This allows you to monitor the performance of individual statements within your functions and procedures. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional suggestion
Suggested change
|
||||||
| {{site.data.alerts.end}} | ||||||
|
|
||||||
| {% if page.cloud != true %} | ||||||
| To view this page, click **SQL Activity** in the left-hand navigation of the DB Console. | ||||||
| {% else %} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,6 +28,16 @@ CREATE PROCEDURE procedure_name(parameters) | |||||
|
|
||||||
| For details, see [`CREATE PROCEDURE`]({% link {{ page.version.version }}/create-procedure.md %}). | ||||||
|
|
||||||
| ## Statement statistics | ||||||
|
|
||||||
| SQL statements executed within stored procedures are tracked in the SQL statistics subsystem and will appear in the [**SQL Activity** > **Statements**]({% link {{ page.version.version }}/ui-statements-page.md %}) page and the [**Insights**]({% link {{ page.version.version }}/ui-insights-page.md %}) page in the DB Console. This allows you to monitor the performance and execution statistics of individual statements within your procedures. | ||||||
|
|
||||||
| These statements will also appear in the [**Transaction details**]({% link {{ page.version.version }}/ui-transactions-page.md %}#transaction-details-page) in the **Statement Fingerprints** table when the stored procedure is invoked as part of a transaction. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| {{site.data.alerts.callout_info}} | ||||||
| [Statement diagnostics]({% link {{ page.version.version }}/explain-analyze.md %}#debug-option) cannot be collected for statements executed inside stored procedures. You can request statement diagnostics for the top-level invocation of the procedure, and the resulting trace includes spans for each statement executed. However, there is no way to target statements executed inside the procedure with a statement diagnostics request. For details, see [Known limitations](#known-limitations). | ||||||
| {{site.data.alerts.end}} | ||||||
|
|
||||||
| ## Examples | ||||||
|
|
||||||
| {% include {{page.version.version}}/sql/movr-statements.md %} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,6 +31,16 @@ The basic components of a user-defined function are a name, list of arguments, r | |||||
| - Can reference tables. | ||||||
| - Can reference only the `SELECT` statement. | ||||||
|
|
||||||
| ## Statement statistics | ||||||
|
|
||||||
| SQL statements executed within user-defined functions are tracked in the SQL statistics subsystem and will appear in the [**SQL Activity** > **Statements**]({% link {{ page.version.version }}/ui-statements-page.md %}) page and the [**Insights**]({% link {{ page.version.version }}/ui-insights-page.md %}) page in the DB Console. This allows you to monitor the performance and execution statistics of individual statements within your functions. | ||||||
|
|
||||||
| These statements will also appear in the [**Transaction details**]({% link {{ page.version.version }}/ui-transactions-page.md %}#transaction-details-page) in the **Statement Fingerprints** table when the UDF is invoked as part of a transaction. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| {{site.data.alerts.callout_info}} | ||||||
| [Statement diagnostics]({% link {{ page.version.version }}/explain-analyze.md %}#debug-option) cannot be collected for statements executed inside user-defined functions. You can request statement diagnostics for the top-level invocation of the function, and the resulting trace includes spans for each statement executed. However, there is no way to target statements executed inside the function with a statement diagnostics request. For details, see [Known limitations](#known-limitations). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Accessibility nit per our style guide:
Suggested change
|
||||||
| {{site.data.alerts.end}} | ||||||
|
|
||||||
| ## Examples | ||||||
|
|
||||||
| ### Create a UDF | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but I suggest adding the
docs-known-limitationlabel to the linked PR. When a PR with that label is merged, our automation will create a JIRA to remove this known limitation.