Performance Advisor

Overview

Cast AI Performance Advisor analyzes your database workloads and provides intelligent recommendations to improve query performance. By examining query patterns and table statistics, Performance Advisor identifies opportunities through strategic index creation and query rewrites. Performance Advisor supports PostgreSQL and MySQL.

How Performance Advisor Works

Performance Advisor operates through a lightweight agent that connects to your database and collects metadata for analysis:

  1. Query Analysis - The agent collects query statistics from the database's query statistics views to understand your actual workload patterns
  2. Metadata Collection - Table structures, existing indexes, and column statistics are collected to inform recommendations

Key Features

Automated Discovery

Performance Advisor automatically identifies:

  • Missing indexes that could accelerate frequent queries
  • Unused indexes that consume storage without providing benefit
  • Partial index opportunities for filtered queries
  • Query rewrites that reduce execution cost without schema changes

Non-Intrusive Collection

The Performance Advisor agent is designed to minimize impact on your production database:

  • Read-only access - The agent only reads system catalogs and statistics
  • No query modification - Your application queries are never altered
  • Lightweight footprint - Runs as a small Kubernetes deployment

Actionable Recommendations

Each recommendation includes:

  • The specific CREATE|DROP INDEX statement or rewritten query to implement
  • Expected performance impact based on query patterns
  • Clear reasoning for why the recommendation was generated

Relationship with DBO Cache

Performance Advisor and DBO Cache are independent products that complement each other. You can use either one alone, or both together for comprehensive database optimization.

CapabilityDBO CachePerformance Advisor
Query response acceleration✓ (via caching)✓ (via better indexes)
Reduces database load
Requires code changesNoNo
Works independentlyYesYes

When used together, these tools address optimization at different layers: Performance Advisor improves query execution at the database level, while DBO Cache reduces round-trips to the database entirely for repeated queries.

Prerequisites

Before enabling Performance Advisor, ensure you have:

  • A supported database: PostgreSQL with the pg_stat_statements extension enabled, or MySQL 5.7+
  • Network connectivity from your Kubernetes cluster to the database
  • A database user with read-only access (requirements vary by database — see the installation guides below)

Getting Started

Ready to optimize your database indexes? Follow the installation guide for your database type.