Back to Journal
release-notesaiperformancepostgrescli

v0.28.0 — Local AI Performance Tuning & 1-Click Index Fixes

Piping EXPLAIN ANALYZE query plans directly into your local Claude CLI with zero API keys required. Includes 1-click index recommendations, AI Schema Architecture Audits in Schema Intel, and sub-millisecond query optimization.

Rohith Gilla
Engineer
3 min read read

Every database developer has been there: a query that ran in 1.2ms on your local laptop with 50 test rows suddenly takes 84ms in staging, and 1.8 seconds in production once your table hits 100,000 rows.

You open your SQL client, type EXPLAIN ANALYZE, and get back a tree of query plan nodes:

~/text
text
Seq Scan on orders  (cost=0.00..1842.00 rows=20000 width=72) (actual time=0.042..84.210 rows=19850 loops=1)
  Filter: (status = 'pending'::text)
  Rows Removed by Filter: 80150
Planning Time: 0.18ms
Execution Time: 84.45ms

To a senior DBA, the diagnosis is clear: Missing index on orders.status. But for product developers, identifying unindexed foreign keys, composite index opportunities, or sequential scan bottlenecks across dozens of microservices requires constant context switching.

With data-peek v0.28.0, we built a direct Bring-Your-Own-Harness (BYOH) integration with the official claude CLI binary.

#Why shell out to local claude -p CLI?

Most AI-enabled developer tools require you to paste API keys into desktop app settings or route your database queries through third-party SaaS proxy gateways. We wanted a design that preserves privacy and simplicity:

  1. Zero Token Storage: data-peek never stores, touches, or transmits your API keys.
  2. Local Authentication: Uses your existing local claude CLI authentication (claude -p --output-format json).
  3. Typed Telemetry: By requesting --output-format json, claude -p returns structured analysis that maps directly to UI components.
~/plaintext
plaintext
┌────────────────────────────────────────────────────────┐
│                      data-peek UI                      │
└───────────────────────────┬────────────────────────────┘
                            │ EXPLAIN ANALYZE + Query

┌────────────────────────────────────────────────────────┐
│             Local main process (Electron)              │
└───────────────────────────┬────────────────────────────┘
                            │ Spawns `claude -p --output-format json`

┌────────────────────────────────────────────────────────┐
│            Claude Code CLI (Local Terminal)            │
└───────────────────────────┬────────────────────────────┘
                            │ Returns Structured JSON Recommendation

┌────────────────────────────────────────────────────────┐
│      Floating Glass Drawer + 1-Click Fix Button       │
└───────────────────────────┴────────────────────────────┘

#1-Click "Apply Index & Re-run"

When you execute a query in data-peek, hitting Analyze (or clicking the yellow/red Performance Indicator badge) opens our glassmorphic AI Copilot drawer:

  • Predicted Speedup Badge: E.g. Predicted ~50x Speedup
  • Lock Safety Indicator: CONCURRENTLY (No table locks required)
  • Generated DDL:
    ~/sql
    sql
    CREATE INDEX CONCURRENTLY idx_orders_status ON orders(status);
  • 1-Click Execution: Hitting Apply Index & Re-run executes the DDL query live on your active database connection and instantly re-runs the performance telemetry.

#AI Schema Architecture Audits

We also expanded our Schema Intel diagnostic tab.

Clicking the new AI Architecture Audit button scans your active database connection's table structures, unindexed foreign keys, and column data types:

  • AI Schema Health Score (e.g. A-, B+)
  • Architectural Recommendations (missing FK indexes, timestamp precision optimizations, security alerts)
  • 1-Click "Open Migration Tab": Opens the generated DDL migration script directly into a new SQL query editor tab for instant review and execution.

#Benchmark Results: 84.2ms ➔ 0.78ms

Testing against a PostgreSQL table of 100,000 orders:

MetricBefore AI FixAfter 1-Click AI FixImprovement
Query StrategySequential ScanIndex Seek (idx_orders_status)Direct B-Tree Seek
Rows Filtered80,150 rows0 (Index Seek)100% reduction
Latency (p50)84.2 ms0.78 ms107x Faster

#Upgrade to v0.28.0 Today

data-peek v0.28.0 is available now. Single-command install for macOS and Linux:

~/bash
bash
curl -fsSL https://install.cat/Rohithgilla12/data-peek | sh

Or view the open-source repository on GitHub.

Join the Future.

A database client built for professional developers. Experience the speed of native code and the power of AI.