Tool

Complete query tuning

Complete Query Tuning is an advanced AI-powered tool designed to finalize database query optimization by applying or discarding tuning changes efficiently. It ensures that performance-enhancing modifications, such as index creations, are safely integrated into your main or specified branch, maintaining clean and optimized database environments.

Neon

Features

  • Applies suggested SQL DDL changes to the main or specified database branch for improved query performance.
  • Ensures safe cleanup of temporary branches used during the tuning process to maintain repository hygiene.
  • Requires prior review and testing of changes in a temporary branch before application to avoid errors.
  • Supports role-based connection handling to maintain security and access control during tuning.
  • Automatically manages the workflow after 'prepare_query_tuning' including approval, application, or discarding of changes.

Benefits

  • Streamlines the query tuning workflow by automating safe application of performance improvements.
  • Minimizes human error by enforcing testing of query changes before final deployment.
  • Enhances database performance and reduces query latency by applying optimized DDL statements.
  • Improves maintainability by cleaning up temporary branches post-tuning, keeping projects organized.
  • Supports flexible deployment options with ability to specify target branches and roles for application.

Description

Complete a query tuning session by either applying the changes to the main branch or discarding them. <important_notes> BEFORE RUNNING THIS TOOL: test out the changes in the temporary branch first by running - run_sql with the suggested DDL statements. - explain_sql_statement with the original query and the temporary branch. This tool is the ONLY way to finally apply changes after the prepare_query_tuning tool to the main branch. You MUST NOT use prepare_database_migration or other tools to apply query tuning changes. You MUST pass the tuning_id obtained from the prepare_query_tuning tool, NOT the temporary branch ID as tuning_id to this tool. You MUST pass the temporary branch ID used in the prepare_query_tuning tool as TEMPORARY branchId to this tool. The tool OPTIONALLY receives a second branch ID or name which can be used instead of the main branch to apply the changes. This tool MUST be called after tool prepare_query_tuning even when the user rejects the changes, to ensure proper cleanup of temporary branches. </important_notes>

This tool:
1. Applies suggested changes (like creating indexes) to the main branch (or specified branch) if approved
2. Handles cleanup of temporary branch
3. Must be called even when changes are rejected to ensure proper cleanup

Workflow:
1. After `prepare_query_tuning` suggests changes
2. User reviews and approves/rejects changes
3. This tool is called to either:
  - Apply approved changes to main branch and cleanup
  - OR just cleanup if changes are rejected

Parameters

1 parameter

NameTypeDescription
paramsrequiredobject

Try Needle today

Streamline AI productivity at your company today

Join thousands of people who have transformed their workflows.

Agentic workflowsAutomations, meet AI agents
AI SearchAll your data, searchable
Chat widgetsDrop-in widget for your website
Developer APIMake your app talk to Needle
    Needle LogoNeedle
    Like many websites, we use cookies to enhance your experience, analyze site traffic and deliver personalized content while you are here. By clicking "Accept", you are giving us your consent to use cookies in this way. Read our more on our cookie policy .