<!-- wp:paragraph -->
<p>3.5 years at MongoDB, and I'm still learning. All consultants do. Every day. That's part of the allure. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Sometimes, however, we learn something that counters what we thought was solid, bedrock knowledge. And it shakes us. And we can either learn from it, celebrate it, and move on -- or not. I choose the former.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This week I was consulting with a customer and we were discussing 'live' Data Migration between MongoDB Clusters. We always advise that <a href="https://docs.mongodb.com/manual/core/index-ttl/">TTL Indexes</a> be removed or disabled in the Source cluster before Live Migration, then added to the Destination cluster afterwards. This part still holds true.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>What surprised me was when this customer said "<strong><em>well, we can't do that in a live Production system because our important queries rely on that index.</em></strong>"</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>And I immediately thought to myself:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://media2.giphy.com/media/l0HlKhcD5AR6ftIbu/source.gif" alt="Shocked Sheila Broflovski GIF by South Park - Find &amp; Share on GIPHY"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>I've always stated, in the training courses I deliver, that TTL indexes are created like other indexes, but <strong>do not</strong> improve query speeds. And that part, my friends, is dead wrong.</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://media.tenor.com/images/3ed6d86a725dc626d25a3f8dd44960e9/tenor.png" alt="Keanu Reeves Whoa GIF - KeanuReeves Whoa Matrix - Discover &amp; Share GIFs"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Yep. Full B-Trees are created for that field, and such an index <strong>will</strong> benefit single-field queries that include that field.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>So, as the first post in my series "Mea Culpa", I'd like to:<br>1) Admit the mistake<br>2) Learn from the mistake<br>3) Apologize to my students</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The only saving grace is that TTL Indexes aren't often used to both expires documents and improve query performance. Nonetheless, I still feel better having gotten this off my chest.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>#catharsis</p>
<!-- /wp:paragraph -->