database-performance

Optimize database access with CQRS, batch queries, and EF Core patterns.

Updated May 31, 2026
One-click install
npx skills add https://github.com/nicolashuber/opencode-config --skill database-performance-nicolashuber
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-performance
Source: https://github.com/nicolashuber/opencode-config/tree/main/skills/database-performance
Command: npx skills add https://github.com/nicolashuber/opencode-config --skill database-performance-nicolashuber

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill unit addresses common database performance issues, guiding on best practices to enhance database access efficiency in applications using EF Core and Dapper.

Core Features & Use Cases

  • Separation of Read and Write Models: Implements CQRS pattern for distinct data handling and optimization.
  • Row Limit Application: Avoids unbounded result sets with configurable Take/Limit parameters.
  • No-Tracking for Read Queries: Disables change tracking in EF Core for performance improvement.
  • Prevention of N+1 Queries: Implements efficient data retrieval with batch and join queries.
  • Use Case: Ideal for software engineers looking to improve the performance of database operations in applications relying on EF Core or Dapper.

Quick Start

Run the command 'database-performance skill execute -l database-performance -i sample.sql' to test a SQL query using this skill unit's patterns.

Frequently Asked Questions about database-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent N+1 queries in EF Core?

To prevent N+1 queries in EF Core, implement batch and join queries for efficient data retrieval. This approach consolidates multiple database round trips into a single query, avoiding severe performance bottlenecks.

What's the best way to optimize read queries using Dapper?

Optimize Dapper read queries by applying row limits to avoid unbounded result sets and using efficient SQL join techniques. Separating read and write models further ensures distinct, streamlined data handling.

Does EF Core no-tracking actually improve database performance?

Yes, disabling change tracking with no-tracking in EF Core significantly improves database performance. It reduces memory overhead and processing time for read-only queries by skipping entity state management.

How do I separate read and write models for SQL optimization?

Separate read and write models by implementing the CQRS pattern for distinct data handling and SQL optimization. This allows tailored query strategies, directly maximizing database access efficiency.

Can I use this database performance skill with both EF Core and Dapper?

Yes, you can use these database performance patterns with both EF Core and Dapper. It optimizes data access by focusing on efficient querying and batch operations compatible across both frameworks.

Why does my database query return unbounded result sets?

Your database query returns unbounded result sets when lacking configurable Take or Limit parameters. Applying strict row limits prevents this issue, restricting data retrieval to only necessary records.