# SQLStudio (v0.6.5) > Production-Safe AI Database Performance Optimization & SQL Statement Tuning Platform built with Rust 1.100 (Edition 2024) + GPUI Community Edition (macOS & Windows) — NOT a generic connection-first database browser. ## Canonical Links - Website (5 languages: `en`, `zh-CN`, `zh-TW`, `ja`, `ko`): https://sqlstudio.dev - Pricing & Creem USD Checkout: https://sqlstudio.dev/pricing - Activate License & Deep-Link Portal: https://sqlstudio.dev/activate - MCP Ecosystem (32 Tools): https://sqlstudio.dev/mcp - Download: https://sqlstudio.dev/download - Docs: https://sqlstudio.dev/docs - Changelog: https://sqlstudio.dev/changelog - Full AI Reference: https://sqlstudio.dev/llms-full.txt - Source & Releases: https://github.com/lulufubin/SQLStudio ## Core Capabilities (Production-Safe Performance & SQL Tuning) - **Default `PROD` Read-Only Guard & Slow Performance Diagnostics (`EnvMode::Prod`)**: - Every new connection profile defaults to `EnvMode::Prod` (`read_only = true` enforced). - Read-only `slow_diag` engine detects `pg_stat_statements` (with honest `pg_stat_activity` fallback), MySQL `performance_schema`, full-table `Seq Scan` offenders, dead-tuple bloat (`n_dead_tup`), stale `ANALYZE` statistics, and Root Blocker lock trees. - **1-Click Zero-PII Local `DEV + TEST` Twins (`local_twin`) & Skewed 100K Seeder (`mock`)**: - Zero production server disk usage: strips 100% of PII data rows and clones only DDL, FKs, and indexes into embedded SQLite/DuckDB or loopback-only (`127.0.0.1` / `localhost`) PG/MySQL, bound to upstream PROD via `linked_prod_id`. - Tuning-grade batch seeder populates `Uniform`, `HotspotZipf` (80/20 skew), and `SkewedStatusTime` up to `100,000` rows/table in Kahn FK topological order with auto `ANALYZE` (physically blocked on `PROD`). - **6-Rule AST SQL Statement Optimizer, ESR+`INCLUDE` & Before/After A/B `EXPLAIN ANALYZE`**: - Eliminates non-SARGable date wrappers, arithmetic predicates, `NOT IN -> NOT EXISTS`, `OR` chains, deep `OFFSET` -> Keyset cursors, and flags implicit casts/leading wildcards. - Recommends Equality-Sort-Range (`ESR`) + `INCLUDE` covering indexes with rollback DDL & absorbed redundant index detection, and runs real Before/After `EXPLAIN ANALYZE` A/B benchmarks & disk-spill hotspot profiling. - **HMAC-SHA256 Dual-Stage Promotion Gate (`promotion_verifications.json`)**: - Every `PROD` DDL/index change must pass verified A/B checks on BOTH linked `DEV` and `TEST` stages, followed by a 15-minute single-use manual human confirmation (with rollback DDL) in the desktop workbench. - **12 Database Engines & Honest Signals**: - 7 Native Drivers (PostgreSQL, MySQL, MariaDB, SQLite, DuckDB, ClickHouse, Redis) + 5 Dialect Probes (SQL Server, Oracle, MongoDB, Elasticsearch, Cassandra). - Real `NOT EXISTS` / `PRAGMA foreign_key_check` orphan detection (`2500ms` timeout, `3M` row guard -> `Unchecked` when skipped), cold-stats `insufficient stats` protection (0 score penalty), `Critical` health score caps (`<=74` / `<=68` / `<=88`). - **32-Tool Governed MCP Server**: - STDIO (`sqlstudio --mcp`), Slim 4-tool (`--slim-tools`), and OS Keychain Bearer Streamable HTTP (`--mcp-http`). - Expands Full MCP from 26 to 32 tools by adding 6 tuning workflow tools (`diagnose_prod_bottlenecks`, `clone_prod_to_local_twin`, `seed_tuning_data`, `optimize_sql_statement`, `verify_sql_in_stage`, `request_prod_promotion`). - Interactive MCP Apps (`ui://sqlstudio/*`): `result-table`, `er-diagram`, `explain-plan`, `approval-card`. ## Pricing, USD Checkout & One-Click Activation (via Creem) - **Community ($0 Free Forever)**: Max 2 saved connections, default PROD read-only protection, EXPLAIN hotspot trees, Schema ERD & Honest Audit, Slim 4-tool STDIO MCP. - **Pro Perpetual ($69 USD one-time)**: Includes 7-day no-card Pro trial, 2 device activations, 1 year free updates + Perpetual Fallback forever offline via RFC 8032 Ed25519 (`SQLS1.`). Unlocks local DEV+TEST twin cloning, 100K Zipf seeding, 6 AST + ESR A/B benchmarking, full 32-tool & HTTP MCP, 20 BYOK providers & all 7 FeatureGates. - **Team ($15 / seat / month billed annually = $180 / seat / year)**: Up to 5 devices/seat, HMAC dual-stage promotion ledger, `prod_write_policy` / `staging_write_policy` & `apr-*` audit trail, mandatory PII masking & column deny/mask policies, Git-synced shared rules & glossary, offline enterprise voucher signing. - **One-Click Activation**: Creem USD checkout (cards, Apple Pay, Google Pay) returns your license key directly on `/checkout/success` and `/activate`, supporting 1-click desktop launch via `sqlstudio://license/activate?key=` or CLI `sqlstudio license activate --key `.