Skip to content

sql,sqlstats: recorded statement stats in UDFs / SPs should respect sql.metrics.transaction_details.max_statement_stats #159831

@kyle-a-wong

Description

@kyle-a-wong

PR #158527 added a new cluster setting and logic to prevent sql stats from having unbounded memory growth when certain workload types are running. This implementation only accounts for statements executed and recorded in the conn executor, but not other areas such as statements stats are recorded, such as in UDFs and SPs. It may be possible for UDFs / SPs to execute millions of statements, causing similar memory issues that were fixed by the previously mentioned PR.

While this will likely have other unknown impacts on the SQL server, we should ensure that SQL Stats can handle this case.

Jira issue: CRDB-58044

Metadata

Metadata

Assignees

Labels

C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-observabilitytarget-release-26.2.0

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions