TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Use the Index, Luke

13 pointsby tmleeabout 1 year ago

3 comments

n4r9about 1 year ago
SQL indexing is definitely something I need to learn more about.<p>At the same time, it feels a bit like it&#x27;s become such a standardised fallback approach that people will sometimes throw indexes at a problem instead of applying some thought to the query.<p>Admittedly, I&#x27;m basing this on a few personal anecdotes. For example, a long time ago an acquaintance posted a question on Facebook about speeding up a query in a database of astronomy data, where they were filtering based on a triangle-inequality style formula a^2 + b^2 &lt; c^2. The first five comments said they would just index the a, b and c columns, which would probably work but the author didn&#x27;t have the right permissions on the DB and only needed to run the query once anyway. I didn&#x27;t know much SQL at the time but suggested trying a quick initial filtering of the form a + b &gt; c on the data before calculating the formula with squares. This apparently sped it up sufficiently for their purpose.
nullfieldabout 1 year ago
Over time I’ve found this site good for getting the basics across.
chasinglogicabout 1 year ago
As an SRE with a database background this should be required reading for any development team.