BeforeMerge

AI-native code review knowledge base. Structured rules that catch what linters miss.

Product

  • Features
  • Explore
  • Pricing
  • Docs
  • GitHub

Company

  • About
  • Blog
  • Contributors
  • Contributing

Legal

  • Privacy Policy
  • Terms of Service
  • MIT License

© 2026 BeforeMerge. Built by Peter Krzyzek

BeforeMerge
Features
Explore
PricingBlogContributorsInstall Guide
3Sign In
FeaturesExplore
RulesSkillsKnowledgePrompts
PricingBlogContributorsInstall Guide
Sign In

Explore

Browse 354 rules, 42 knowledge articles, and 28 prompt templates across security, performance, architecture, and quality.

Sort:

81 rules matching filters

Use EXPLAIN to verify query plans

MEDIUM

Run EXPLAIN on slow or important queries to confirm indexes are used and scans are bounded.

PerformanceMySQL & MariaDB
Previous1234Next

Automate these checks on every PR

BeforeMerge scans your pull requests against these rules automatically. Get actionable feedback before code ships to production.

Join WaitlistLearn More

Set an appropriate transaction isolation level

MEDIUM

Choose an isolation level (e.g. READ COMMITTED) that matches your concurrency and consistency needs.

PerformanceMySQL & MariaDB

Index columns used in JOIN, WHERE, and ORDER BY

MEDIUM

Add indexes on columns that appear in join conditions, filters, and sort clauses.

PerformanceMySQL & MariaDB

Keep WHERE clauses sargable

MEDIUM

Avoid wrapping indexed columns in functions so the optimizer can use the index.

PerformanceMySQL & MariaDB

Avoid implicit type conversions in comparisons

MEDIUM

Compare columns against values of the same type to avoid silent casts that disable indexes.

PerformanceMySQL & MariaDB

Set statement and idle-in-transaction timeouts

MEDIUM

Configure statement_timeout and idle_in_transaction_session_timeout so stuck queries and orphaned transactions are killed automatically.

PerformanceManaged Databases

Monitor connection-limit usage and slow queries

MEDIUM

Track connection count against max_connections and capture slow queries (e.g. via pg_stat_statements) with alerting thresholds.

PerformanceManaged Databases

Right-size the instance and monitor CPU, IO, and storage

MEDIUM

Match instance class and storage to actual load, and alert on CPU, IOPS, and free-storage thresholds before they are hit.

PerformanceManaged Databases

Avoid long-held locks in migrations

HIGH

Set a lock_timeout, split steps, and add columns nullable-then-backfill to keep migration locks short.

PerformancePostgreSQL

Add constraints NOT VALID then VALIDATE on big tables

MEDIUM

Add FK and CHECK constraints as NOT VALID, then VALIDATE CONSTRAINT separately to avoid a long blocking scan.

PerformancePostgreSQL

Use partial and expression indexes for filtered queries

MEDIUM

Index only the rows or computed expressions your queries actually filter on to cut index size and speed lookups.

PerformancePostgreSQL

Be autovacuum-aware on high-churn tables

MEDIUM

Tune autovacuum per-table on high-churn tables so dead tuples and bloat don't degrade performance.

PerformancePostgreSQL

Use jsonb, not json

MEDIUM

Store JSON documents as jsonb to get binary storage, indexing, and efficient operators.

PerformancePostgreSQL

EXPLAIN/ANALYZE slow queries before optimizing

MEDIUM

Inspect the query plan with EXPLAIN ANALYZE to find sequential scans and missing indexes.

PerformanceSQL & Databases

Avoid N+1 queries (batch or join)

HIGH

Fetch related data with a join or a single batched query instead of one query per row.

PerformanceSQL & Databases

Use connection pooling

MEDIUM

Reuse database connections through a pool instead of opening a new connection per request.

PerformanceSQL & Databases

Use keyset (cursor) pagination instead of large OFFSET

MEDIUM

Paginate with a WHERE filter on the last seen key rather than OFFSET on deep pages.

PerformanceSQL & Databases

Defer or async non-critical scripts

MEDIUM

Load analytics, chat, and third-party scripts with defer/async so they never block rendering.

PerformanceWeb Performance

Preconnect to critical third-party origins

MEDIUM

Warm up DNS/TLS for required cross-origin hosts early with preconnect or dns-prefetch.

PerformanceWeb Performance

Compress and cache static assets aggressively

MEDIUM

Serve hashed assets with long-lived immutable cache headers and enable Brotli/gzip compression.

PerformanceWeb Performance

Code-split and lazy-load non-critical JavaScript

MEDIUM

Dynamically import below-the-fold and rarely-used components so the initial bundle stays small.

PerformanceWeb Performance

Optimize font loading

MEDIUM

Self-host fonts, preload critical ones, and use font-display: swap to avoid invisible or shifting text.

PerformanceWeb Performance

Serve responsive, modern-format images

HIGH

Use the framework Image component with srcset and AVIF/WebP so each device downloads an appropriately sized, well-compressed image.

PerformanceWeb Performance

Improve INP by keeping the main thread free

HIGH

Break up long tasks and minimize hydration so the page responds quickly to clicks and taps.

PerformanceWeb Performance