querymem
pgEdge Labs: The querymem Postgres extension for estimating query memory usage
querymem · pgEdge Labs: The querymem Postgres extension for estimating query memory usage
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101739 | querymem | querymem | 1.0 | STAT | PostgreSQL | C |
Usage
Sources:
- Official upstream README
- Official extension control file (querymem.control)
- Official extension SQL (querymem–1.0.sql)
querymem — > Don’t set work_mem too high; every query node can use that much memory. Use it when collecting or interpreting the corresponding PostgreSQL statistics. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
get_query_mem(text)is an extension function and returnsINT.
Requirements and Caveats
- The reviewed control file declares default version
1.0. - The control file marks the extension as relocatable.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.