Inspect SQL Server Query Plans and Verify Backups
Diagnose a SQL Server query using representative plan evidence and validate that the database can be restored in an isolated environment.
Record SQL Server edition and version, database compatibility level, schema revision, query text or approved query ID, and representative parameters. Collect an estimated plan when the statement should not be executed. Obtain an actual execution plan only where running the query is permitted and safe, preferably in staging with representative data. Treat plans as sensitive because they can contain schema names and values. Keep production access and impact under the existing database process. ## Key Points - [SQL Server execution plans](https://learn.microsoft.com/en-us/sql/relational-databases/performance/execution-plans) - [SQL Server backup and restore](https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/back-up-and-restore-of-sql-server-databases)
skilldb get database-services-skills/sql-serverFull skill: 30 linesInspect SQL Server Query Plans and Verify Backups
Reproduce the query in context
Record SQL Server edition and version, database compatibility level, schema revision, query text or approved query ID, and representative parameters. Collect an estimated plan when the statement should not be executed. Obtain an actual execution plan only where running the query is permitted and safe, preferably in staging with representative data. Treat plans as sensitive because they can contain schema names and values. Keep production access and impact under the existing database process.
Pick two realistic parameter cases if data distribution is uneven. Record duration and available CPU and I/O measurements. In the plan, compare estimated and actual row counts for meaningful operators. Inspect scans or seeks, large lookups, sorts, spills and join behavior in context. A scan may be appropriate for a large share of rows. A missing-index suggestion should be reviewed against overlapping indexes and write cost.
Validate one change at a time
Choose a concrete hypothesis, such as poor cardinality for a specific filter or unnecessary reads caused by a non-covering index. Apply one change to a representative environment and re-run the same inputs. Verify the result rows as well as performance. Capture the plan, measurements, and maintenance implications. Avoid clearing caches or changing server settings as a shortcut to collecting evidence.
Plan rollback before proposing a production change. Record how the change affects write volume, locking, and other consumers. Use the database owner's process for applied schema or configuration changes. A report based on an estimated plan should say what runtime evidence remains needed.
Exercise recoverability independently
Review the recovery model, backup schedule, retention and target recovery point. Identify the required full, differential, and log backups based on the chosen recovery objective. Include encryption keys or certificates in the authorized recovery inventory where relevant. An available backup file is only one part of restore readiness.
Run a restore drill to an isolated target with a separate database name. Verify that the restored point matches the stated objective and that representative reads, integrity checks, and app startup behave as expected. Record restore duration, the artifact chain used and any missing inputs. Keep source backups intact. Provide the plan findings and restore evidence separately so query tuning is not confused with verified recoverability.
References
Install this skill directly: skilldb add database-services-skills
Related Skills
Supabase
Build with Supabase as a backend-as-a-service. Use this skill when the project needs to integrate Supabase for PostgreSQL database, authentication, real-time subscriptions, storage, edge functions, row-level security, vector embeddings, or as a Firebase alternative. Covers the Supabase client SDK, database queries, auth, RLS policies, real-time, storage, and edge functions.
Timescaledb
Build with TimescaleDB for time-series data. Use this skill when the project needs to store and query time-series data such as IoT sensor readings, application metrics, financial tick data, or event logs. Covers hypertables, continuous aggregates, compression, retention policies, and real-time analytics on top of PostgreSQL.
Turso
Build with Turso as an edge SQLite database. Use this skill when the project needs to integrate Turso (libSQL) for edge-distributed SQLite, embedded replicas, multi-tenant databases, or lightweight serverless data storage. Covers the Turso client SDK, embedded replicas, multi-db, schema migrations, and ORM integration.
Cassandra
Build with Apache Cassandra for high-availability distributed data. Use this skill when the project needs a wide-column database for massive write throughput, multi-region replication, or always-on availability. Covers data modeling, partition keys, CQL, the cassandra-driver for Node.js, and operational patterns for production clusters.
Clickhouse
Build with ClickHouse for real-time analytics and OLAP workloads. Use this skill when the project needs columnar storage for fast aggregation queries over billions of rows — log analytics, event tracking, product analytics, or business intelligence. Covers table engines, MergeTree family, materialized views, and the ClickHouse Node.js client.
Cockroachdb
Build with CockroachDB as a distributed SQL database. Use this skill when the project needs to integrate CockroachDB for globally distributed PostgreSQL-compatible SQL, multi-region deployments, serializable transactions, or horizontal scaling. Covers CockroachDB Serverless, node-postgres integration, multi-region patterns, and ORM compatibility.