#

Database Optimization

9 articles tagged #Database Optimization

Advertisement

SQL CTEs vs Subqueries: Why Your Query Returns Different Row Counts

Are your SQL CTE and subquery versions returning different row counts? Learn why this happens, how query logic, joins, filtering, and execution plans affect results, and how to debug row count discrepancies across major SQL databases.

Oct 15, 2026 6m read πŸ‘ 2

Django ORM N+1 Queries in Serializers: Detecting and Fixing Them

N+1 query bugs in Django serializers can silently turn a fast endpoint into a database-hammering bottleneck. Learn how to detect them with django-debug-toolbar and nplusone, then fix them permanently with select_related and prefetch_related.

Jun 28, 2026 8m read πŸ‘ 39

Fixing PostgreSQL UPSERT That Silently Skips Updates on Conflict

Your INSERT ... ON CONFLICT DO UPDATE looks right, but rows are never actually updated. This guide digs into the common causes β€” wrong conflict targets, excluded column mistakes, and WHERE clause gotchas β€” and shows you how to fix each one.

Jun 23, 2026 10m read πŸ‘ 79
πŸ“¬ Weekly Newsletter

Stay ahead of the curve

Get the best programming tutorials, data analytics tips, and tool reviews delivered to your inbox every week.

No spam. Unsubscribe anytime.