Recommend Redis cache targets
recommend_redis_cache_targetsAnalyze pg_stat_user_tables to identify read-heavy, low-write PostgreSQL tables suited for Redis caching, returning candidate tables with metrics and a ready-to-run CREATE FOREIGN TABLE stub.
Instructions
Recommend tables that would benefit from a Redis cache layer. Inspects pg_stat_user_tables for read-heavy, low-write relations whose working set fits comfortably in Redis (default: read/write ratio ≥ 10, ≥ 1000 reads, ≤ 1M rows). When server is provided the generated ready_to_run_sql stub targets that server name; otherwise the stub uses a placeholder operators must substitute. Advisor is read-only — never touches Redis itself. Returns an object with server and candidates — a list of objects with schema, table, reads, writes, read_write_ratio, estimated_row_count, reason (read_only_lookup_table / small_hot_relation / read_heavy_low_write / moderate_read_dominant), and ready_to_run_sql (a CREATE FOREIGN TABLE stub).
Example: recommend_redis_cache_targets(server='redis_primary', limit=10)
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "recommend_redis_cache_targets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| server | No | ||
| database | No | Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected. | |
| max_rows | No | ||
| min_reads_per_day | No | ||
| min_read_write_ratio | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | ||
| candidates | Yes |