Skip to content

High memory consumption from explain plan generation for statistics collection #77944

@jocrl

Description

@jocrl

This was raised by this support ticket. Turning off the sql.metrics.statement_details.plan_collection.enabled cluster settings should fix the customer's immediate issue, but this issue describes the underlying issue with our code. Further details including those private to the customer can be found in that support issue, but the gist of the underlying problem is as follows.

This is on 21.1..12. Memory consumption ballooned in the function BuildProtoTree, from generation of explain plans for very large statements such as this one from the customer.

I suspect that the larger or more likely cause of the OOM is this other issue: #77963

However, this issue is to describe that one other possible contributor to the OOM might be that very large statements use a lot of memory to generate their explain plan. We can check this by profiling the memory consumption for generating the explain plan for the customer's statement, and checking whether it is reasonable.

Jira issue: CRDB-13865

Epic CRDB-20388

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-observabilityRelated to observability of the SQL layerC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions