spring-boot-query-optimization
Installation
SKILL.md
Query and Latency Optimization
A slow query is a symptom with a location. Find the layer first, prove it with a measurement, change one thing, and measure the same workload again. Anything else is guessing with a schema change attached.
When to use
- A p95 or p99 latency regression that traces to database work.
- Detection of N+1 query patterns through statistics or SQL log analysis.
- Offset pagination that degrades at depth, or a
SELECT count(*)on a hot path. - Connection pool wait time, throughput ceilings, or lock contention symptoms.
- Choosing between a projection read path, batching, or a cache layer.
- Turning a change that felt faster into a change that is proven faster.
When not to use
- SQL dialect, index type theory, and plan node interpretation: hand off to
spring-boot-postgresql. - Entity mappings, associations, fetch annotations, and dirty checking: hand off to
spring-boot-hibernate. - Repository interfaces, Specifications, and the pagination contract: hand off to
spring-boot-data-jpa. - Metric, trace, and dashboard infrastructure: hand off to
spring-boot-observability.