<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SQL on Jure</title><link>https://juredev.com/en/tags/sql/</link><description>Recent content in SQL on Jure</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 12 May 2026 08:03:18 -0400</lastBuildDate><atom:link href="https://juredev.com/en/tags/sql/index.xml" rel="self" type="application/rss+xml"/><item><title>Doctrine ORM Isn't for Everything: DBAL and the Hybrid Repository Pattern</title><link>https://juredev.com/en/blog/2026/doctrine-orm-dbal-hybrid-repository-pattern/</link><pubDate>Tue, 12 May 2026 08:01:39 -0400</pubDate><guid>https://juredev.com/en/blog/2026/doctrine-orm-dbal-hybrid-repository-pattern/</guid><description>&lt;p&gt;In previous articles, we explored why the ORM consumes so much memory and how to mitigate it using chunked &lt;code&gt;flush()&lt;/code&gt;, &lt;code&gt;clear()&lt;/code&gt;, and &lt;code&gt;toIterable()&lt;/code&gt;. If you&amp;rsquo;ve made it this far, you&amp;rsquo;re already convinced of the problem.&lt;/p&gt;
&lt;p&gt;This article is the next step: how to consciously step outside the ORM when you don&amp;rsquo;t need it, without leaving the Doctrine ecosystem or breaking your project&amp;rsquo;s architecture.&lt;/p&gt;
&lt;h2 id="the-starting-point-you-already-know-the-cost"&gt;The Starting Point: You Already Know the Cost&lt;/h2&gt;
&lt;p&gt;We won&amp;rsquo;t rehash why &lt;code&gt;findAll()&lt;/code&gt; can crush your memory or why &lt;code&gt;flush()&lt;/code&gt; with 50,000 entities takes ages. That&amp;rsquo;s already clear.&lt;/p&gt;</description></item><item><title>Hybrid Architecture 2.0: How I Automated the Intelligence of My Content Hubs</title><link>https://juredev.com/en/blog/2026/hybrid-architecture-2-0-automating-content-hubs/</link><pubDate>Sun, 10 May 2026 07:03:22 -0400</pubDate><guid>https://juredev.com/en/blog/2026/hybrid-architecture-2-0-automating-content-hubs/</guid><description>&lt;p&gt;In the &lt;a href="https://juredev.com/en/blog/2026/hybrid-architecture-hugo-wordpress-blog/"&gt;previous article&lt;/a&gt;, I explained how I rescued my best articles from WordPress&amp;rsquo;s chronological graveyard using Hugo to build knowledge hubs. The result was a fast, clean, and well-organized &lt;code&gt;/temas/&lt;/code&gt; section.&lt;/p&gt;
&lt;p&gt;Yet there was a problem I didn&amp;rsquo;t mention: every time I published a new post, I had to sit in front of my computer, run the script manually, and wait for Hugo to compile. If I was away from home or only had my phone, the Hubs remained outdated.&lt;/p&gt;</description></item><item><title>Doctrine and Memory Consumption: How UnitOfWork and Hydration Can Ruin Your Performance (and How to Avoid It)</title><link>https://juredev.com/en/blog/2026/doctrine-memory-consumption-unitofwork-hydration/</link><pubDate>Thu, 07 May 2026 09:02:03 -0400</pubDate><guid>https://juredev.com/en/blog/2026/doctrine-memory-consumption-unitofwork-hydration/</guid><description>&lt;p&gt;In the &lt;a href="https://juredev.com/en/blog/2026/doctrine-at-scale-handle-millions-records/"&gt;previous article&lt;/a&gt;, we looked at how to survive when processing millions of records with Doctrine: using batched &lt;code&gt;flush()&lt;/code&gt;, &lt;code&gt;clear()&lt;/code&gt;, and &lt;code&gt;toIterable()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;But &lt;strong&gt;why do those techniques actually work?&lt;/strong&gt; The answer lies within two internal components of Doctrine that most developers underestimate or simply ignore: the &lt;strong&gt;UnitOfWork&lt;/strong&gt; and the &lt;strong&gt;hydration&lt;/strong&gt; process.&lt;/p&gt;
&lt;p&gt;Understanding how these components operate will not only help you optimize batch processes, workers, or exports. It will fundamentally change how you design your code when dealing with large volumes of data.&lt;/p&gt;</description></item><item><title>SQLite 3.53.0: The Silent Evolutions That Are More Than Welcome</title><link>https://juredev.com/en/blog/2026/sqlite-3-53-0-silent-evolutions/</link><pubDate>Sun, 12 Apr 2026 11:09:57 -0400</pubDate><guid>https://juredev.com/en/blog/2026/sqlite-3-53-0-silent-evolutions/</guid><description>&lt;p&gt;It&amp;rsquo;s not always the flashy announcements with all the hype that end up changing how we work. Sometimes, the updates that arrive quietly are the ones that resolve friction we&amp;rsquo;ve been dragging around for years.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SQLite&lt;/strong&gt; needs no introduction. It is, by far, the most deployed database engine in the world, yet it rarely makes headlines. Version &lt;code&gt;3.53.0&lt;/code&gt; is an excellent example of that philosophy: it arrives without fanfare, but brings technical improvements that simplify the daily lives of those of us who work with it.&lt;/p&gt;</description></item><item><title>Entity Framework Core at Scale: Why Your App Crumbles with Millions of Records (and How to Prevent It)</title><link>https://juredev.com/en/blog/2026/ef-core-at-scale-millions-of-records/</link><pubDate>Sat, 21 Mar 2026 08:55:20 -0400</pubDate><guid>https://juredev.com/en/blog/2026/ef-core-at-scale-millions-of-records/</guid><description>&lt;p&gt;When you&amp;rsquo;re working on small or medium projects with &lt;strong&gt;&lt;a href="https://en.wikipedia.org/wiki/Entity_Framework"&gt;Entity Framework Core&lt;/a&gt;&lt;/strong&gt;, everything runs like a charm: expressive queries, clean code, productivity through the roof.&lt;/p&gt;
&lt;p&gt;And then suddenly… millions of records arrive.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not that the data grows gradually and gives you time to react. No. One day you&amp;rsquo;re comfortable with 50,000 rows, and the next day your application starts struggling: queries that used to run in milliseconds now take seconds (or minutes), &lt;code&gt;SaveChanges()&lt;/code&gt; turns into torture, memory spikes, and timeouts pop up everywhere.&lt;/p&gt;</description></item><item><title>Doctrine at Scale: How to Handle Millions of Records Without Crashing Your App</title><link>https://juredev.com/en/blog/2026/doctrine-at-scale-handle-millions-records/</link><pubDate>Thu, 12 Mar 2026 19:06:55 -0400</pubDate><guid>https://juredev.com/en/blog/2026/doctrine-at-scale-handle-millions-records/</guid><description>&lt;p&gt;Using an ORM like Doctrine is fantastic for day-to-day productivity. Suddenly, you can think in terms of objects instead of writing SQL by hand and let the framework handle almost all persistence. It&amp;rsquo;s great… until a table crosses the million-row threshold.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s when the ORM can go from being your best friend to the main reason your application crawls or crashes with an &lt;code&gt;Allowed memory size of X bytes exhausted&lt;/code&gt; error.&lt;/p&gt;</description></item><item><title>Understand What Your Database Is Really Doing: A Practical Guide to EXPLAIN ANALYZE in PostgreSQL</title><link>https://juredev.com/en/blog/2026/practical-guide-explain-analyze-postgresql/</link><pubDate>Sun, 01 Mar 2026 11:01:31 -0400</pubDate><guid>https://juredev.com/en/blog/2026/practical-guide-explain-analyze-postgresql/</guid><description>&lt;p&gt;If you&amp;rsquo;ve ever run a query and stared at the loading spinner thinking &amp;ldquo;why is this taking so long?&amp;rdquo;, it&amp;rsquo;s time to stop guessing.&lt;/p&gt;
&lt;p&gt;Almost every time a query is slow, it&amp;rsquo;s not the fault of &lt;a href="https://juredev.com/en/blog/2026/postgresql-optimize-queries-large-tables/"&gt;PostgreSQL&lt;/a&gt;. It&amp;rsquo;s that we don&amp;rsquo;t know what it is doing under the hood.&lt;/p&gt;
&lt;p&gt;And that&amp;rsquo;s where &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; shines.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s the closest thing to popping the hood of your car while the engine is running: you see exactly what is happening, how long each part takes, and where everything is getting clogged.&lt;/p&gt;</description></item><item><title>PostgreSQL: How to Make Queries on Multi-Million Row Tables Stop Being a Headache</title><link>https://juredev.com/en/blog/2026/postgresql-optimize-queries-large-tables/</link><pubDate>Mon, 23 Feb 2026 10:12:15 -0400</pubDate><guid>https://juredev.com/en/blog/2026/postgresql-optimize-queries-large-tables/</guid><description>&lt;p&gt;If you&amp;rsquo;ve already wrestled with large tables in &lt;a href="https://juredev.com/en/blog/2026/master-sql-queries-mysql-mariadb-large-tables/"&gt;MySQL&lt;/a&gt; or &lt;a href="https://juredev.com/en/blog/2026/master-sql-server-large-tables-tsql-optimization/"&gt;SQL Server&lt;/a&gt;, you know all too well that performance isn&amp;rsquo;t a &amp;ldquo;nice to have&amp;rdquo;: it&amp;rsquo;s pure survival. In PostgreSQL, once a logging, audit, or transactions table comfortably crosses 20–30 million rows, a poorly designed query doesn&amp;rsquo;t just run slow… it can make the CPU scream, saturate disk I/O, and generate table bloat everywhere that impacts every other database running on the same cluster.&lt;/p&gt;</description></item><item><title>Master SQL Server with Large Tables: Practical T-SQL Optimization Guide</title><link>https://juredev.com/en/blog/2026/master-sql-server-large-tables-tsql-optimization/</link><pubDate>Fri, 30 Jan 2026 22:08:37 -0400</pubDate><guid>https://juredev.com/en/blog/2026/master-sql-server-large-tables-tsql-optimization/</guid><description>&lt;p&gt;Not long ago, I published a practical guide for optimizing queries in &lt;strong&gt;MySQL and MariaDB&lt;/strong&gt; when dealing with large tables (you can read it here: &lt;a href="https://juredev.com/en/blog/2026/master-sql-queries-mysql-mariadb-large-tables/"&gt;Master SQL Queries in MySQL and MariaDB: A Practical Guide from Scratch for Large Tables&lt;/a&gt;). Now I&amp;rsquo;m sharing the &lt;strong&gt;&lt;a href="https://www.microsoft.com/es-ar/sql-server"&gt;SQL Server&lt;/a&gt;&lt;/strong&gt; edition, so here it is: focused on T-SQL, featuring the same practical approach tailored directly to &lt;strong&gt;Microsoft&amp;rsquo;s&lt;/strong&gt; database engine.&lt;/p&gt;
&lt;p&gt;In inventory and logistics systems, performance is not a &amp;ldquo;nice to have&amp;rdquo;: it is mission-critical. Picture a warehouse operator scanning a barcode to log incoming merchandise… and the screen freezes for 25–30 seconds. You aren&amp;rsquo;t just consuming server resources: you&amp;rsquo;re halting a physical operation.&lt;/p&gt;</description></item><item><title>Mastering SQL Queries in MySQL and MariaDB: A Practical Guide from Scratch for Large Tables</title><link>https://juredev.com/en/blog/2026/master-sql-queries-mysql-mariadb-large-tables/</link><pubDate>Fri, 16 Jan 2026 19:58:30 -0400</pubDate><guid>https://juredev.com/en/blog/2026/master-sql-queries-mysql-mariadb-large-tables/</guid><description>&lt;p&gt;Imagine a query that should take less than a second to respond ending up taking 30 seconds instead. It is not just annoying: it bottlenecks the server, runs up your hosting (or cloud) bill, and worst of all… it makes users close the tab and leave.&lt;/p&gt;
&lt;p&gt;This guide is aimed at developers who are starting out with &lt;strong&gt;&lt;a href="https://juredev.com/blog/tag/sql/"&gt;SQL&lt;/a&gt;&lt;/strong&gt; (or who already use it but feel they need to polish their skills) and work with &lt;strong&gt;&lt;a href="https://www.mysql.com/"&gt;MySQL&lt;/a&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;a href="https://www.mysql.com/"&gt;MariaDB&lt;/a&gt;&lt;/strong&gt;. The goal is for you to walk away with real, immediately applicable tools so that querying large tables stops being a headache, without needing to become a database administrator or mess with advanced server configurations.&lt;/p&gt;</description></item><item><title>SQL Query Optimization: Practical Tips for Better Performance</title><link>https://juredev.com/en/blog/2025/sql-query-optimization-practical-tips-better-performance/</link><pubDate>Thu, 08 May 2025 19:42:30 -0400</pubDate><guid>https://juredev.com/en/blog/2025/sql-query-optimization-practical-tips-better-performance/</guid><description>&lt;p&gt;If you work with databases, you know that a poorly optimized &lt;strong&gt;SQL&lt;/strong&gt; query can slow down your application, frustrate users, and overload your server. Optimizing your queries is not just a technical chore—it is a way to improve user experience and ensure your system scales smoothly. In this article, I share practical tips with clear examples inspired by real-world scenarios such as online stores, CRM systems, social networks, and financial analytics. Each tip includes code snippets, impact metrics, and troubleshooting tools so you can easily apply them to your projects. Let&amp;rsquo;s get started!&lt;/p&gt;</description></item><item><title>Advanced Joins with LINQ and Entity Framework: Use Cases and Optimization in C#</title><link>https://juredev.com/en/blog/2025/advanced-joins-linq-entity-framework-csharp/</link><pubDate>Sat, 05 Apr 2025 19:13:19 -0400</pubDate><guid>https://juredev.com/en/blog/2025/advanced-joins-linq-entity-framework-csharp/</guid><description>&lt;p&gt;Working with databases almost always involves combining information from multiple tables. That is where joins become our greatest allies, enabling us to connect related data logically and efficiently. In C#, thanks to LINQ (Language Integrated Query) and Entity Framework (EF), this task becomes even simpler: we can do it directly in code, safely, and without wrestling with complex SQL queries.&lt;/p&gt;
&lt;p&gt;In a previous article, I explored the power of SQL joins and how to combine data with practical examples. If you want to check it out before moving forward, you can find it here: &lt;a href="https://juredev.com/en/blog/2025/sql-joins-explained-with-examples/"&gt;The Power of SQL Joins: Learn to Combine Your Data with Simple Examples&lt;/a&gt;. Now, in this guide, we will focus on how to use joins with LINQ and EF in a practical, accessible way. We will cover everything from the basics to more advanced use cases, all with clear examples and useful tips. Whether you are just getting started with these tools or looking to refresh your knowledge, this article is for you.&lt;/p&gt;</description></item><item><title>The Power of SQL Joins: Learn How to Connect Your Data with Simple Examples</title><link>https://juredev.com/en/blog/2025/sql-joins-explained-with-examples/</link><pubDate>Tue, 25 Mar 2025 20:58:32 -0400</pubDate><guid>https://juredev.com/en/blog/2025/sql-joins-explained-with-examples/</guid><description>&lt;p&gt;If you have ever wondered how to get more out of your databases, &lt;strong&gt;SQL&lt;/strong&gt; Joins are your entry ticket. These tools allow you to connect information across different tables simply and efficiently, giving you the power to build more interesting and useful queries. In this introductory guide, we will explore what Joins are, the most common types, and how to use them with examples that anyone can run. We will use standard &lt;strong&gt;SQL&lt;/strong&gt; syntax, so they will work across virtually any database engine you have at hand. To keep things practical, we will work with a simple scenario: employees (&lt;code&gt;e&lt;/code&gt;), departments (&lt;code&gt;d&lt;/code&gt;), and their locations (&lt;code&gt;du&lt;/code&gt;), represented by these tables:&lt;/p&gt;</description></item></channel></rss>