Skip to content

cacheStats ​

Command: cacheStats
Category: System Admin
Status: Production Ready

Description ​

View SQL plan cache and result cache statistics from the SAP HANA database. This command allows you to analyze cache performance and memory utilization by querying the M_SQL_PLAN_CACHE and M_RESULT_CACHE system views.

Syntax ​

bash
hana-cli cacheStats [options]

Command Diagram ​

Parameters ​

Options ​

OptionAliasTypeDefaultDescription
--cacheType-tstringallType of cache to query. Choices: plan, result, all
--limit-lnumber50Maximum number of cache entries to return

Connection Parameters ​

OptionAliasTypeDefaultDescription
--admin-abooleanfalseConnect via admin (default-env-admin.json)
--conn-string-Connection filename to override default-env.json

Troubleshooting ​

OptionAliasTypeDefaultDescription
--disableVerbose--quietbooleanfalseDisable verbose output - removes all extra output that is only helpful to human readable interface
--debug-dbooleanfalseDebug hana-cli itself by adding output of LOTS of intermediate details

Examples ​

View All Cache Statistics ​

bash
hana-cli cacheStats --cacheType all

Display both SQL plan cache and result cache statistics.

View SQL Plan Cache Only ​

bash
hana-cli cacheStats --cacheType plan --limit 100

View the top 100 entries from the SQL plan cache.

View Result Cache Only ​

bash
hana-cli cacheStats --cacheType result --limit 25

View the top 25 entries from the result cache.

See the Commands Reference for other commands in this category.

See Also ​