<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Indexing on PG Blog</title><link>https://pg-blogs.netlify.app/tags/indexing/</link><description>Recent content in Indexing on PG Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 03 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://pg-blogs.netlify.app/tags/indexing/index.xml" rel="self" type="application/rss+xml"/><item><title>Database Indexing and Query Optimization for Java Developers</title><link>https://pg-blogs.netlify.app/posts/18-database-indexing-and-query-optimization-for-java/</link><pubDate>Fri, 03 Jul 2026 00:00:00 +0000</pubDate><guid>https://pg-blogs.netlify.app/posts/18-database-indexing-and-query-optimization-for-java/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Fixing N+1 queries (see the &lt;a href="https://pg-blogs.netlify.app/posts/8-avoiding-orm-traps-and-n-plus-1-in-java/"&gt;previous post&lt;/a&gt;) gets your Hibernate app down to a handful of queries per request. The next bottleneck is what each of those queries costs once your tables have millions of rows — and that is almost always a question of indexing.&lt;/p&gt;
&lt;p&gt;An index turns &amp;ldquo;scan every row&amp;rdquo; into &amp;ldquo;look it up directly.&amp;rdquo; Get the index wrong — or skip it — and a query that took 2ms in development takes 4 seconds in production once real data volume shows up.&lt;/p&gt;</description></item><item><title>Database Indexing and Query Optimization for Python Developers</title><link>https://pg-blogs.netlify.app/posts/19-database-indexing-and-query-optimization-for-python/</link><pubDate>Fri, 03 Jul 2026 00:00:00 +0000</pubDate><guid>https://pg-blogs.netlify.app/posts/19-database-indexing-and-query-optimization-for-python/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Fixing N+1 queries with &lt;code&gt;select_related&lt;/code&gt;/&lt;code&gt;prefetch_related&lt;/code&gt; or &lt;code&gt;selectinload&lt;/code&gt; (see the &lt;a href="https://pg-blogs.netlify.app/posts/9-avoiding-orm-traps-and-n-plus-1-in-python/"&gt;previous post&lt;/a&gt;) gets you down to a small, sane number of queries per request. The next bottleneck is what each query costs once the table has millions of rows — and that is almost always about indexing.&lt;/p&gt;
&lt;p&gt;An index turns &amp;ldquo;scan every row&amp;rdquo; into &amp;ldquo;look it up directly.&amp;rdquo; Skip it, and a query that&amp;rsquo;s instant in development takes seconds once real data volume shows up in production.&lt;/p&gt;</description></item></channel></rss>