Skip to main content
Glama
aliyun

Hologres MCP Server

Official
by aliyun

gather_hg_table_statistics

Execute the ANALYZE TABLE command on Hologres databases to collect table statistics, improving query optimization performance for better query plans.

Instructions

Execute the ANALYZE TABLE command to have Hologres collect table statistics, enabling QO to generate better query plans

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaYesSchema name in Hologres database
tableYesTable name in Hologres database

Implementation Reference

  • Registers the 'gather_hg_table_statistics' tool, including its description and input schema requiring 'schema' and 'table' parameters.
    Tool( name="gather_hg_table_statistics", description="Execute the ANALYZE TABLE command to have Hologres collect table statistics, enabling QO to generate better query plans", inputSchema={ "type": "object", "properties": { "schema": { "type": "string", "description": "Schema name in Hologres database" }, "table": { "type": "string", "description": "Table name in Hologres database" } }, "required": ["schema", "table"] } ),
  • Defines the input schema for the tool, specifying schema and table as required string parameters.
    inputSchema={ "type": "object", "properties": { "schema": { "type": "string", "description": "Schema name in Hologres database" }, "table": { "type": "string", "description": "Table name in Hologres database" } }, "required": ["schema", "table"] }
  • Handler logic in call_tool function: validates inputs, constructs the ANALYZE query, and passes to execution helper.
    elif name == "gather_hg_table_statistics": schema = arguments.get("schema") table = arguments.get("table") if not all([schema, table]): raise ValueError("Schema and table are required") query = f"ANALYZE {schema}.{table}" elif name == "get_hg_query_plan":
  • In handle_call_tool helper: executes the ANALYZE query via psycopg and returns a success message tailored for this tool.
    cursor.execute(query) # 特殊处理 ANALYZE 命令 if tool_name == "gather_hg_table_statistics": return f"Successfully {query}"

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aliyun/alibabacloud-hologres-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server