Skip to content

Memory management and best practices #6087

Description

@robert-s-lee

Exalate commented:

Title

Fine-tune max-sql-memory best practice.

Description

Encountered getting Error: pq: windower-limited: memory budget exceeded: 112146104 bytes requested, 10240 currently allocated, 67108864 bytes in budget while running insert into fac_chrg select row_number() OVER () as fac_id,* from (select current_date(), random()::string, chrg_id from chrg_cd limit 7985445);

Outline

max-sql-memory describes how much RAM all SQL processors can take up on the whole cluster whereas sql.distsql.temp_storage.workmem is how much memory a single processor of a single query can use, so the former is “global” whereas the latter is “local”

There are couple other settings that describe how much memory joins and sorts can use before they are forced to spill to disk, but all other memory-intensive operations look at sql.distsql.temp_storage.workmem

cc https://cockroachlabs.slack.com/archives/C8HD41C82/p1575302414002600

potentially other issues to consolidate this:

Expected Audience

Developers and DBAs

Jira Issue: DOC-383

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions